Refactor type/format labels to enable translations

This commit is contained in:
Claudio Ortolina
2025-01-29 11:04:19 +00:00
parent 96bd453900
commit 9e1f00c9a8
16 changed files with 193 additions and 132 deletions
@@ -1,6 +1,7 @@
defmodule MusicLibraryWeb.ArtistLive.RecordComponents do
use MusicLibraryWeb, :live_component
import MusicLibraryWeb.RecordComponents, only: [format_label: 1, type_label: 1]
alias MusicLibrary.Records
attr :records, :list, required: true
@@ -46,9 +47,7 @@ defmodule MusicLibraryWeb.ArtistLive.RecordComponents do
{record.title}
</p>
<p class="pointer-events-none block text-sm font-medium text-zinc-500">
{Records.Record.format_long_label(record.format)} · {Records.Record.type_long_label(
record.type
)}
{format_label(record.format)} · {type_label(record.type)}
</p>
<p class="pointer-events-none block text-sm font-medium text-zinc-500">
{Records.Record.format_release(record.release)}