Listing Ammo

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

No Ammo 😔

<%= live_patch("Add your first box!", to: Routes.ammo_group_index_path(@socket, :new), class: "btn btn-primary" ) %> <% else %> <%= live_patch("New Ammo group", to: Routes.ammo_group_index_path(@socket, :new), class: "btn btn-primary" ) %>
<%= for ammo_group <- @ammo_groups do %> <% end %>
Count Price paid Notes
<%= ammo_group.count %> <%= ammo_group.price_paid %> <%= ammo_group.notes %> <%= live_redirect("Show", to: Routes.ammo_group_show_path(@socket, :show, ammo_group)) %> <%= live_patch("Edit", to: Routes.ammo_group_index_path(@socket, :edit, ammo_group)) %> <%= link("Delete", to: "#", phx_click: "delete", phx_value_id: ammo_group.id, data: [confirm: "Are you sure?"] ) %>
<% end %>
<%= if @live_action in [:new, :edit] do %> <%= live_modal(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) ) %> <% end %>