Listing Ammo Types

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

No Ammo Types 😔

<%= live_patch("Add your first type!", to: Routes.ammo_type_index_path(@socket, :new), class: "btn btn-primary" ) %> <% else %> <%= live_patch("New Ammo type", to: Routes.ammo_type_index_path(@socket, :new), class: "btn btn-primary" ) %>
<%= for ammo_type <- @ammo_types do %> <% end %>
Name Case material Bullet type Grain Manufacturer
<%= ammo_type.name %> <%= ammo_type.case_material %> <%= ammo_type.bullet_type %> <%= ammo_type.grain %> <%= ammo_type.manufacturer %> <%= live_redirect("Show", to: Routes.ammo_type_show_path(@socket, :show, ammo_type)) %> <%= live_patch("Edit", to: Routes.ammo_type_index_path(@socket, :edit, ammo_type)) %> <%= link("Delete", to: "#", phx_click: "delete", phx_value_id: ammo_type.id, data: [confirm: "Are you sure?"] ) %>
<% end %>
<%= if @live_action in [:new, :edit] do %> <%= live_modal(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(@socket, :index) ) %> <% end %>