import { useState } from "react"; import type { Product } from "../types/product"; import { ProductCard } from "../components/ProductCard"; const PRODUCTS: Product[] = [ { id: "1", name: "Keyboard", price: 79, category: "peripherals", inStock: true }, { id: "2", name: "Mouse", price: 49, category: "peripherals", inStock: true }, { id: "3", name: "Monitor", price: 399, category: "displays", inStock: false }, ]; export default function Home() { const [cart, setCart] = useState([]); return (

Shop

{cart.length} items in cart

{PRODUCTS.map(p => ( setCart(prev => [...prev, id])} /> ))}
); }