defmodule CanneryWeb.ContainerLive.ContainerCard do
@moduledoc """
Display card for a container
"""
use CanneryWeb, :component
alias CanneryWeb.Endpoint
def container_card(assigns) do
~H"""
<%= live_redirect to: Routes.container_show_path(Endpoint, :show, @container),
class: "link" do %>
<%= @container.name %>
<% end %>
<%= if @container.desc do %>
Description: <%= @container.desc %>
<% end %>
Type: <%= @container.type %>
<%= if @container.location do %>
Location: <%= @container.location %>
<% end %>
<%= if assigns |> Map.has_key?(:inner_block) do %>
<%= render_slot(@inner_block) %>
<% end %>
"""
end
end