// app/search/[collection]/page.tsx // Simulate fetching products for a collection async function getProductsByCollection(collectionName: string) { // Simulate network delay await new Promise(resolve => setTimeout(resolve, 50)); const allProducts: { [key: string]: any[] } = { 't-shirts': [ { id: 'ts1', name: 'Cool T-Shirt', price: { amount: '19.99', currencyCode: 'USD' }, image: { src: '/placeholder-tshirt1.jpg', alt: 'T-Shirt 1' } }, { id: 'ts2', name: 'Graphic Tee', price: { amount: '24.99', currencyCode: 'USD' }, image: { src: '/placeholder-tshirt2.jpg', alt: 'T-Shirt 2' } }, { id: 'ts3', name: 'Plain V-Neck', price: { amount: '15.50', currencyCode: 'USD' }, image: { src: '/placeholder-tshirt3.jpg', alt: 'Plain V-Neck' } }, ], 'accessories': [ { id: 'ac1', name: 'Stylish Cap', price: { amount: '15.00', currencyCode: 'USD' }, image: { src: '/placeholder-cap.jpg', alt: 'Cap' } }, { id: 'ac2', name: 'Leather Belt', price: { amount: '35.00', currencyCode: 'USD' }, image: { src: '/placeholder-belt.jpg', alt: 'Leather Belt' } }, ], 'footwear': [ { id: 'fw1', name: 'Running Shoes', price: { amount: '79.99', currencyCode: 'USD' }, image: { src: '/placeholder-shoes1.jpg', alt: 'Running Shoes' } }, { id: 'fw2', name: 'Casual Sneakers', price: { amount: '65.00', currencyCode: 'USD' }, image: { src: '/placeholder-sneakers1.jpg', alt: 'Casual Sneakers' } }, { id: 'fw3', name: 'Formal Shoes', price: { amount: '120.00', currencyCode: 'USD' }, image: { src: '/placeholder-shoes2.jpg', alt: 'Formal Shoes' } }, ] // Add more dummy collections and products as needed }; return allProducts[collectionName.toLowerCase()] || []; } export default async function CollectionPage({ params }: { params: { collection: string } }) { const products = await getProductsByCollection(params.collection); const collectionName = params.collection.charAt(0).toUpperCase() + params.collection.slice(1); return (

Products in: {collectionName}

{/* Placeholder Filters */}

Filters

{/* Basic display of range value - not functional */}
$0 - $200
{/* Main Content Area (Search + Product List) */}
{/* Placeholder Search Input */}
{/* Product List */}
{products.length > 0 ? ( products.map((product: any) => ( // Using any for mock simplicity
{product.image.alt}

{product.name}

{product.price.amount} {product.price.currencyCode}

{/* Use a generic link for now; specific product pages are handled by [handle] route */} View Details
)) ) : (

No products found in this collection.

)}
); }