improve code in table components

This commit is contained in:
2022-12-03 21:41:54 -05:00
parent 58b32817ba
commit 0894293620
9 changed files with 68 additions and 65 deletions

View File

@ -66,15 +66,16 @@ defmodule CanneryWeb.Components.ContainerTableComponent do
end)
end)
extra_data = %{
current_user: current_user,
tag_actions: tag_actions,
actions: actions
}
rows =
containers
|> Enum.map(fn container ->
container
|> get_row_data_for_container(columns, %{
current_user: current_user,
tag_actions: tag_actions,
actions: actions
})
container |> get_row_data_for_container(columns, extra_data)
end)
socket