<%= @ammo_type.name %>

<%= if @ammo_type.desc do %> Desc: <%= @ammo_type.desc %> <% end %> <%= if @ammo_type.case_material do %> Case material: <%= @ammo_type.case_material %> <% end %> <%= if @ammo_type.bullet_type do %> Bullet type: <%= @ammo_type.bullet_type %> <% end %> <%= if @ammo_type.grain do %> Grain: <%= @ammo_type.grain %> <% end %> <%= if @ammo_type.manufacturer do %> Manufacturer: <%= @ammo_type.manufacturer %> <% end %>
<%= live_patch to: Routes.ammo_type_show_path(@socket, :edit, @ammo_type), class: "text-primary-500 link" do %> <% end %> <%= link to: "#", class: "text-primary-500 link", phx_click: "delete", data: [confirm: "Are you sure you want to delete #{@ammo_type.name}?"] do %> <% end %>

<%= if @ammo_type.ammo_groups |> Enum.empty?() do %> No ammo for this type <% else %> <%= for ammo_group <- @ammo_type.ammo_groups do %> <.ammo_group_card ammo_group={ammo_group} /> <% end %> <% end %>
<%= if @live_action in [:edit] do %> <%= live_modal(CanneryWeb.AmmoTypeLive.FormComponent, id: @ammo_type.id, title: @page_title, action: @live_action, ammo_type: @ammo_type, return_to: Routes.ammo_type_show_path(@socket, :show, @ammo_type) ) %> <% end %>