diff --git a/src/blocks/Showcase/Component.tsx b/src/blocks/Showcase/Component.tsx index 4ce1076..427e6e3 100644 --- a/src/blocks/Showcase/Component.tsx +++ b/src/blocks/Showcase/Component.tsx @@ -5,12 +5,12 @@ 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 + // Added category field to match CMS configuration category: 'engineering' | 'design' tags?: { tag: string }[] links?: { label: string; url: string; newTab?: boolean }[] @@ -64,6 +64,7 @@ export function ShowcaseBlock(props: ShowcaseBlockProps): React.ReactElement | n if (!Array.isArray(items) || items.length === 0) return null + // Filters items based on the 'category' field defined in CMS const filteredItems = filter === 'all' ? items : items.filter((item) => item.category === filter) return ( @@ -74,7 +75,7 @@ export function ShowcaseBlock(props: ShowcaseBlockProps): React.ReactElement | n {subheading &&

{subheading}

} - {/* Filter Navigation */} + {/* Category Filter Navigation */}
{(['all', 'engineering', 'design'] as const).map((f) => (