From 864d849fba6e8bf52ca50ec322b2aee984c2a22c Mon Sep 17 00:00:00 2001 From: Mackie Date: Sat, 6 Jun 2026 08:25:34 +0800 Subject: [PATCH] tabs --- src/blocks/Showcase/Component.tsx | 142 +++++++++++++++++++++++++++++- 1 file changed, 141 insertions(+), 1 deletion(-) 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 = ( +
+ {imageUrl ? ( + {imageAlt + ) : ( +
+