defmodule CanneryWeb.Components.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 %>
<%= gettext("Description:") %>
<%= @container.desc %>
<% end %>
<%= gettext("Type:") %>
<%= @container.type %>
<%= if @container.location do %>
<%= gettext("Location:") %>
<%= @container.location %>
<% end %>
<%= if assigns |> Map.has_key?(:inner_block) do %>
<%= render_slot(@inner_block) %>
<% end %>
"""
end
end