<%= gettext("Listing Ammo") %>

<%= if @ammo_groups |> Enum.empty?() do %>

<%= gettext("No Ammo") %> 😔

<%= live_patch(dgettext("actions", "Add your first box!"), to: Routes.ammo_group_index_path(@socket, :new), class: "btn btn-primary" ) %> <% else %> <%= live_patch(dgettext("actions", "New Ammo group"), to: Routes.ammo_group_index_path(@socket, :new), class: "btn btn-primary" ) %>
<%= for ammo_group <- @ammo_groups do %> <% end %>
<%= gettext("Count") %> <%= gettext("Price paid") %> <%= gettext("Notes") %>
<%= ammo_group.count %> <%= if ammo_group.price_paid do %> $ <%= ammo_group.price_paid |> :erlang.float_to_binary(decimals: 2) %> <% end %> <%= ammo_group.notes %> <%= live_redirect(dgettext("actions", "View"), to: Routes.ammo_group_show_path(@socket, :show, ammo_group) ) %> <%= live_patch to: Routes.ammo_group_index_path(@socket, :edit, ammo_group), class: "text-primary-500 link" do %> <% end %> <%= link to: "#", class: "text-primary-500 link", phx_click: "delete", phx_value_id: ammo_group.id, data: [confirm: dgettext("prompts", "Are you sure you want to delete this ammo?")] do %> <% end %>
<% end %>
<%= if @live_action in [:new, :edit] do %> <.modal return_to={Routes.ammo_group_index_path(@socket, :index)}> <.live_component module={CanneryWeb.AmmoGroupLive.FormComponent} id={@ammo_group.id || :new} title={@page_title} action={@live_action} ammo_group={@ammo_group} return_to={Routes.ammo_group_index_path(@socket, :index)} current_user={@current_user} /> <% end %>