diff --git a/src/blocks/Showcase/Component.tsx b/src/blocks/Showcase/Component.tsx index 0cfbf08..4ce1076 100644 --- a/src/blocks/Showcase/Component.tsx +++ b/src/blocks/Showcase/Component.tsx @@ -1 +1,141 @@ -2 +'use client' + +import React, { useState } from 'react' +import Image from 'next/image' +import { Container } from '@/components/ui/Container' +import type { Media as MediaType } from '@/payload-types' + +// Updated type to include category for the 15-project Lab structure +type ShowcaseItem = { + image?: MediaType | null + imageUrl?: string + title: string + description?: string + category: 'engineering' | 'design' + tags?: { tag: string }[] + links?: { label: string; url: string; newTab?: boolean }[] +} + +type ShowcaseBlockProps = { + heading?: string + subheading?: string + items?: ShowcaseItem[] +} + +function ShowcaseImage({ item }: { item: ShowcaseItem }): React.ReactElement { + const image = item.image + const imageUrl = image != null && typeof image === 'object' && 'url' in image ? image.url : null + const imageAlt = + image != null && typeof image === 'object' && 'alt' in image ? image.alt : item.title + + const imgContent = ( +
{subheading}
} +{item.description}
+ )} + {item.tags && item.tags.length > 0 && ( +