Format scrobble count tooltip

This commit is contained in:
Claudio Ortolina
2025-09-02 13:56:23 +03:00
parent 3316df1861
commit c1c94e478e
@@ -75,7 +75,20 @@ defmodule MusicLibraryWeb.StatsComponents do
</p>
</dd>
<dd :if={@tooltip} class="mt-1">
<.tooltip value={@tooltip}>
<.tooltip>
<:content>
<script :type={Phoenix.LiveView.ColocatedHook} name=".FormatNumber">
export default {
mounted() {
this.el.innerText = parseInt(this.el.innerText).toLocaleString();
},
updated() {
this.el.innerText = parseInt(this.el.innerText).toLocaleString();
}
}
</script>
<span id={"#{@title}-counter-tooltip"} phx-hook=".FormatNumber">{@tooltip}</span>
</:content>
<.link
:if={@path}
navigate={@path}