cannery/lib/cannery_web/live/ammo_type_live/index.html.heex

44 lines
1.3 KiB
Plaintext

<div class="flex flex-col space-y-8 justify-center items-center">
<h1 class="title text-2xl title-primary-500">
<%= gettext("Catalog") %>
</h1>
<%= if @rows |> Enum.empty?() do %>
<h2 class="title text-xl text-primary-600">
<%= gettext("No Ammo Types") %>
<%= display_emoji("😔") %>
</h2>
<.link patch={Routes.ammo_type_index_path(Endpoint, :new)} class="btn btn-primary">
<%= dgettext("actions", "Add your first type!") %>
</.link>
<% else %>
<.link patch={Routes.ammo_type_index_path(Endpoint, :new)} class="btn btn-primary">
<%= dgettext("actions", "New Ammo type") %>
</.link>
<.live_component
module={CanneryWeb.Components.TableComponent}
id="ammo_types_index_table"
action={@live_action}
columns={@columns}
rows={@rows}
/>
<% end %>
</div>
<%= if @live_action in [:new, :edit, :clone] do %>
<.modal return_to={Routes.ammo_type_index_path(Endpoint, :index)}>
<.live_component
module={CanneryWeb.AmmoTypeLive.FormComponent}
id={@ammo_type.id || :new}
title={@page_title}
action={@live_action}
ammo_type={@ammo_type}
return_to={Routes.ammo_type_index_path(Endpoint, :index)}
current_user={@current_user}
}
/>
</.modal>
<% end %>