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

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

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

<%= live_patch(dgettext("actions", "Add your first container!"), to: Routes.container_index_path(@socket, :new), class: "btn btn-primary" ) %> <% else %> <%= live_patch(dgettext("actions", "New Container"), to: Routes.container_index_path(@socket, :new), class: "btn btn-primary" ) %> <% end %>
<%= for container <- @containers do %> <.container_card container={container}> <%= live_patch to: Routes.container_index_path(@socket, :edit, container), class: "text-primary-500 link" do %> <% end %> <%= link to: "#", class: "text-primary-500 link", phx_click: "delete", phx_value_id: container.id, data: [ confirm: dgettext("prompts", "Are you sure you want to delete %{name}?", name: container.name) ] do %> <% end %> <% end %>
<%= if @live_action in [:new, :edit] do %> <.modal return_to={Routes.container_index_path(@socket, :index)}> <.live_component module={CanneryWeb.ContainerLive.FormComponent} id={@container.id || :new} title={@page_title} action={@live_action} container={@container} return_to={Routes.container_index_path(@socket, :index)} current_user={@current_user} /> <% end %>