Uniform use of .section/1 across all stats components

This commit is contained in:
Claudio Ortolina
2026-03-22 18:47:27 +00:00
parent a83efe9908
commit 87cbf55ee5
3 changed files with 258 additions and 256 deletions
@@ -337,4 +337,23 @@ defmodule MusicLibraryWeb.StatsComponents do
_other -> ""
end
end
attr :container_class, :string, default: nil
slot :title, required: true
slot :side_actions
slot :inner_block, required: true
def section(assigns) do
~H"""
<div class={["mt-5", @container_class]}>
<div class="flex items-center justify-between">
<h1 class="text-base font-semibold text-zinc-900 lg:text-2xl dark:text-zinc-200">
{render_slot(@title)}
</h1>
{render_slot(@side_actions)}
</div>
{render_slot(@inner_block)}
</div>
"""
end
end