Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

1.4 KB
Raw Blame
<%# locals: path, direction, title %>
<%= link_to path, class: "hidden md:flex w-full bg-container hover:bg-container-inset rounded-xl border border-alpha-black-25 shadow-xs p-4 items-center justify-between" do %>
  <% if direction == 'previous' %>
    <%= icon("arrow-left") %>
  <% end %>
  <div class="<%= "grow" if direction == "next" %> <%= "text-right" if direction == "previous" %>">
    <span class="block text-sm text-secondary"><%= t(".#{direction}") %></span>
    <span class="block text-sm font-medium text-primary"><%= title %></span>
  </div>
  <% if direction == 'next' %>
    <%= icon("arrow-right") %>
  <% end %>
<% end %>

<%# Mobile version %>
<%= link_to path, class: "md:hidden w-full bg-container hover:bg-container-inset rounded-xl border border-alpha-black-25 shadow-xs py-3 px-4" do %>
  <div class="flex items-center justify-between">
    <% if direction == 'previous' %>
      <div class="flex items-center gap-3">
        <%= icon("arrow-left") %>
        <span class="text-sm text-secondary">Back</span>
      </div>
      <div>
        <span class="text-sm font-medium text-primary"><%= title %></span>
      </div>
    <% else %>
      <div>
        <span class="text-sm text-secondary">Next</span>
      </div>
      <div class="flex items-center gap-3">
        <span class="text-sm font-medium text-primary"><%= title %></span>
        <%= icon("arrow-right") %>
      </div>
    <% end %>
  </div>
<% end %>