display link to container in table

This commit is contained in:
2022-11-19 13:16:55 -05:00
parent fd583f2941
commit 25d4f1916a
8 changed files with 20 additions and 6 deletions

View File

@ -162,6 +162,19 @@ defmodule CanneryWeb.ContainerLive.Index do
end
@spec get_value_for_key(atom(), Container.t()) :: any()
defp get_value_for_key(:name, %{id: id, name: container_name}) do
assigns = %{id: id, container_name: container_name}
{container_name,
~H"""
<div class="flex flex-wrap justify-center items-center">
<.link navigate={Routes.container_show_path(Endpoint, :show, @id)} class="link">
<%= @container_name %>
</.link>
</div>
"""}
end
defp get_value_for_key(:packs, container) do
container |> Containers.get_container_ammo_group_count!()
end