diff --git a/src/app/page.tsx b/src/app/page.tsx index fc7b45c..336c170 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -20,8 +20,8 @@ const HomePage = async () => { ; interface Props { className?: string - maxHeight?: string + imageClassName?: string + featured?: boolean images?: Maybe<{ data: { attributes: Maybe<{ @@ -21,17 +26,25 @@ interface Props { }> } -export const ImageGallery: React.FC = ({ className, maxHeight, images }) => { +export const ImageGallery: React.FC = ({ className, imageClassName, featured, images }) => { + const maxImageHeight = images?.data.reduce((max, cur) => { + const height = cur.attributes?.height ?? 0; + return max < height ? height : max; + }, 0); + if (!images || !images.data.length) { return null; } return (
- = ({ className, maxHeight, images }) { images.data.map((image, idx) => image && (
- +
+ +
)) } -
+
); };