{gettext("Records")}

<%!-- TODO: replace with OSS version --%>
<.album_preview record={@latest_record} title={gettext("Latest purchase")} class="col-span-2 sm:col-span-3" /> <.counter title={gettext("Total collection")} count={@collection_count} path={~p"/collection"} /> <.counter title={gettext("Total wishlist")} count={@wishlist_count} path={~p"/wishlist"} />

{gettext("Formats")}

<%!-- TODO: replace with OSS version --%>
{format_label(format)}
<.link class="text-xl lg:text-2xl font-semibold hover:text-zinc-500 dark:text-zinc-300 dark:hover:text-zinc-200" navigate={~p"/collection?query=format:#{format}"} > {count}

{gettext("Types")}

<%!-- TODO: replace with OSS version --%>
{type_label(type)}
<.link class="text-xl lg:text-2xl font-semibold hover:text-zinc-500 dark:text-zinc-300 dark:hover:text-zinc-200" navigate={~p"/collection?query=type:#{type}"} > {count}

{gettext("Top %{n} Artists", %{n: length(@records_by_artist)})}

<.vertical_bar_chart data={@records_by_artist} width={600} height={35 * length(@records_by_artist)} color_class="fill-red-500" label_fn={fn datum -> datum.name end} value_fn={fn datum -> datum.count end} label_click={ fn datum -> JS.navigate(~p"/artists/#{datum.id}") end } class="w-full" />

{gettext("Top %{n} Genres", %{n: length(@records_by_genre)})}

<.vertical_bar_chart data={@records_by_genre} width={600} height={35 * length(@records_by_genre)} color_class="fill-zinc-500" label_fn={fn {genre, _count} -> genre end} value_fn={fn {_genre, count} -> count end} label_click={ fn {genre, _count} -> JS.navigate(~p"/collection?#{%{query: ~s(genre:"#{genre}")}}") end } class="w-full" />

{gettext("Scrobble activity")}

<%!-- TODO: replace with OSS version --%> <.button phx-click={JS.push("set_scrobble_activity_mode", value: %{"mode" => :albums})} class={[ "rounded-l-md rounded-r-none", @scrobble_activity_mode == :albums && "!bg-zinc-100 dark:!bg-zinc-700" ]} > {gettext("Albums")} <.button phx-click={JS.push("set_scrobble_activity_mode", value: %{"mode" => :tracks})} class={[ "-ml-px rounded-r-md rounded-l-none", @scrobble_activity_mode == :tracks && "!bg-zinc-100 dark:!bg-zinc-700" ]} > {gettext("Tracks")}