defmodule CanneryWeb.Components.ContainerCard do @moduledoc """ Display card for a container """ use CanneryWeb, :component import CanneryWeb.Components.TagCard alias Cannery.{Containers, Containers.Container, Repo} alias CanneryWeb.Endpoint alias Phoenix.LiveView.Rendered attr :container, Container, required: true slot(:tag_actions) slot(:inner_block) @spec container_card(assigns :: map()) :: Rendered.t() def container_card(%{container: container} = assigns) do assigns = assigns |> assign(container: container |> Repo.preload([:tags, :ammo_groups])) |> assign_new(:tag_actions, fn -> [] end) ~H"""