Link badges in barcode scanner results

This commit is contained in:
Claudio Ortolina
2025-02-22 13:34:21 +00:00
parent 570ce4b145
commit 15b60a4619
2 changed files with 11 additions and 7 deletions
@@ -114,8 +114,12 @@ defmodule MusicLibraryWeb.BarcodeScannerComponent do
</p>
</div>
<.badge :if={@status == :new} color={:gray} text={gettext("New")} />
<.badge :if={@status == :wishlisted} color={:yellow} text={gettext("Wishlisted")} />
<.badge :if={@status == :collected} color={:green} text={gettext("Collected")} />
<.link :if={@status == :wishlisted} navigate={~p"/wishlist/#{@record_id}"}>
<.badge color={:yellow} text={gettext("Wishlisted")} />
</.link>
<.link :if={@status == :collected} navigate={~p"/collection/#{@record_id}"}>
<.badge color={:green} text={gettext("Collected")} />
</.link>
</div>
"""
end