From 92126882b62f3905ddd8ae66cb2237d80fb29dff Mon Sep 17 00:00:00 2001 From: Max Richter Date: Wed, 12 Nov 2025 13:35:39 +0100 Subject: [PATCH] feat: correctly size search result items --- components/Image.tsx | 9 +++++++-- components/Rating.tsx | 1 - islands/Search.tsx | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/components/Image.tsx b/components/Image.tsx index a4aea94..a4f3975 100644 --- a/components/Image.tsx +++ b/components/Image.tsx @@ -47,6 +47,11 @@ const Image = ( "/api/images", ); + const hasDimensions = typeof props.width === "number" && + typeof props.height === "number"; + const sizes = hasDimensions ? "" : responsiveAttributes.sizes; + const srcset = hasDimensions ? "" : responsiveAttributes.srcset; + return ( ; }, ) => { diff --git a/islands/Search.tsx b/islands/Search.tsx index fc3c540..ee43eb6 100644 --- a/islands/Search.tsx +++ b/islands/Search.tsx @@ -55,8 +55,8 @@ const SearchResultImage = ({ src }: { src: string }) => { return ( preview image