Don't display some stats when there's no record

This commit is contained in:
Claudio Ortolina
2026-03-29 08:48:30 +01:00
parent 2e3f44495f
commit bb1c53c44f
@@ -27,7 +27,7 @@ defmodule MusicLibraryWeb.StatsLive.Index do
wishlist_count={@wishlist_count} wishlist_count={@wishlist_count}
scrobble_count={@scrobble_count} scrobble_count={@scrobble_count}
/> />
<div class="grid gap-x-5 md:grid-cols-2"> <div :if={@collection_count > 0} class="grid gap-x-5 md:grid-cols-2">
<.formats_stats collection_count_by_format={@collection_count_by_format} /> <.formats_stats collection_count_by_format={@collection_count_by_format} />
<.types_stats collection_count_by_type={@collection_count_by_type} /> <.types_stats collection_count_by_type={@collection_count_by_type} />
</div> </div>
@@ -42,7 +42,7 @@ defmodule MusicLibraryWeb.StatsLive.Index do
streams={@streams} streams={@streams}
/> />
<div class="grid grid-cols-1 gap-x-5 md:grid-cols-2 lg:grid-cols-3"> <div :if={@collection_count > 0} class="grid grid-cols-1 gap-x-5 md:grid-cols-2 lg:grid-cols-3">
<.top_collection_artists records_by_artist={@records_by_artist} /> <.top_collection_artists records_by_artist={@records_by_artist} />
<.top_collection_genres records_by_genre={@records_by_genre} /> <.top_collection_genres records_by_genre={@records_by_genre} />
<.top_release_years records_by_release_year={@records_by_release_year} /> <.top_release_years records_by_release_year={@records_by_release_year} />