Display size for image search previews
This commit is contained in:
@@ -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}×{result.height}
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user