Display size for image search previews

This commit is contained in:
Claudio Ortolina
2026-02-09 19:02:12 +00:00
parent ddc4691522
commit 4b03102aa7
3 changed files with 19 additions and 1 deletions
+2
View File
@@ -20,6 +20,8 @@ defmodule BraveSearch.API do
%{
thumbnail_url: get_in(result, ["thumbnail", "src"]),
image_url: get_in(result, ["properties", "url"]),
width: get_in(result, ["properties", "width"]),
height: get_in(result, ["properties", "height"]),
title: Map.get(result, "title", ""),
source: Map.get(result, "source", "")
}
@@ -365,6 +365,16 @@ defmodule MusicLibraryWeb.Components.RecordForm do
class="aspect-square w-full object-cover"
loading="lazy"
/>
<span
:if={result.width && result.height}
class={[
"absolute bottom-0 inset-x-0",
"bg-black/60 text-white text-xs text-center",
"py-0.5"
]}
>
{result.width}&times;{result.height}
</span>
</button>
</div>
</div>