<%= @container.name %>

<%= gettext("Description:") %> <%= @container.desc %> <%= gettext("Type:") %> <%= @container.type %> <%= gettext("Location:") %> <%= @container.location %> <%= unless @ammo_groups |> Enum.empty?() do %> <%= if @show_used do %> <%= gettext("Total packs:") %> <% else %> <%= gettext("Packs:") %> <% end %> <%= Enum.count(@ammo_groups) %> <%= if @show_used do %> <%= gettext("Total rounds:") %> <% else %> <%= gettext("Rounds:") %> <% end %> <%= @container |> Containers.get_container_rounds!() %> <% end %>
<.link patch={Routes.container_show_path(Endpoint, :edit, @container)} class="text-primary-600 link" aria-label={gettext("Edit %{container_name}", container_name: @container.name)} > <.link href="#" class="text-primary-600 link" phx-click="delete_container" data-confirm={ dgettext("prompts", "Are you sure you want to delete %{name}?", name: @container.name) } aria-label={gettext("Delete %{container_name}", container_name: @container.name)} >

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

<%= gettext("No tags for this container") %> <%= display_emoji("😔") %>

<.link patch={Routes.container_show_path(Endpoint, :edit_tags, @container)} class="btn btn-primary" > <%= dgettext("actions", "Why not add one?") %>
<% else %>
<.simple_tag_card :for={tag <- @container.tags} tag={tag} />
<.link patch={Routes.container_show_path(Endpoint, :edit_tags, @container)} class="text-primary-600 link" >
<% end %>
<.toggle_button action="toggle_show_used" value={@show_used}> <%= gettext("Show used") %> <.toggle_button action="toggle_table" value={@view_table}> <%= gettext("View as table") %>
<%= if @ammo_groups |> Enum.empty?() do %>

<%= gettext("No ammo in this container") %>

<% else %> <%= if @view_table do %> <.live_component module={CanneryWeb.Components.AmmoGroupTableComponent} id="ammo-type-show-table" ammo_groups={@ammo_groups} current_user={@current_user} > <:ammo_type :let={%{name: ammo_type_name} = ammo_type}> <.link navigate={Routes.ammo_type_show_path(Endpoint, :show, ammo_type)} class="link"> <%= ammo_type_name %> <% else %>
<.ammo_group_card :for={ammo_group <- @ammo_groups} ammo_group={ammo_group} />
<% end %> <% end %>
<.modal :if={@live_action == :edit} return_to={Routes.container_show_path(Endpoint, :show, @container)} > <.live_component module={CanneryWeb.ContainerLive.FormComponent} id={@container.id} title={@page_title} action={@live_action} container={@container} return_to={Routes.container_show_path(Endpoint, :show, @container)} current_user={@current_user} /> <.modal :if={@live_action == :edit_tags} return_to={Routes.container_show_path(Endpoint, :show, @container)} > <.live_component module={CanneryWeb.ContainerLive.EditTagsComponent} id={@container.id} title={@page_title} action={@live_action} container={@container} return_to={Routes.container_show_path(Endpoint, :show, @container)} current_user={@current_user} />