Listing Containers

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

No containers

<%= live_patch to: Routes.container_index_path(@socket, :new), class: "btn btn-primary" do %> Create your first container! <% end %>
<% else %> <%= live_patch to: Routes.container_index_path(@socket, :new), class: "btn btn-primary" do %> New Container <% end %> <% end %>
<%= for container <- @containers do %>

<%= container.name %>

<%= if container.desc do %> Description: <%= container.desc %> <% end %> Type: <%= container.type %> <%= if container.location do %> Location: <%= container.location %> <% end %>
<%= live_redirect("Show", to: Routes.container_show_path(@socket, :show, container), class: "text-primary-500 link" ) %> <%= live_patch("Edit", to: Routes.container_index_path(@socket, :edit, container), class: "text-primary-500 link" ) %> <%= link("Delete", to: "#", class: "text-primary-500 link", phx_click: "delete", phx_value_id: container.id, data: [confirm: "Are you sure you want to delete #{container.name}?"] ) %>
<% end %>
<%= if @live_action in [:new, :edit] do %> <%= live_modal(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 %>