import React, { useState, useEffect } from 'react'; import { Page, Product, CartItem } from './types'; import { MOCK_PRODUCTS } from './constants'; import Header from './components/Header'; import ProductCard from './components/ProductCard'; import CartSidebar from './components/CartSidebar'; import AIAssistant from './components/AIAssistant'; import MagicEditor from './components/MagicEditor'; const App: React.FC = () => { const [currentPage, setCurrentPage] = useState(Page.HOME); const [cartItems, setCartItems] = useState([]); const [isCartOpen, setIsCartOpen] = useState(false); const addToCart = (product: Product) => { setCartItems(prev => { const existing = prev.find(item => item.id === product.id); if (existing) { return prev.map(item => item.id === product.id ? { ...item, quantity: item.quantity + 1 } : item); } return [...prev, { ...product, quantity: 1 }]; }); setIsCartOpen(true); }; const removeFromCart = (id: string) => { setCartItems(prev => prev.filter(item => item.id !== id)); }; const updateQuantity = (id: string, delta: number) => { setCartItems(prev => prev.map(item => { if (item.id === id) { const newQty = Math.max(1, item.quantity + delta); return { ...item, quantity: newQty }; } return item; })); }; return (
acc + i.quantity, 0)} toggleCart={() => setIsCartOpen(!isCartOpen)} />
{currentPage === Page.HOME && (

The Lumina Collective

Curated artifacts and apparel designed at the intersection of humanity and intelligence.

{MOCK_PRODUCTS.map(product => ( ))}
)} {currentPage === Page.MAGIC_LAB && ( )}
setIsCartOpen(false)} items={cartItems} onRemove={removeFromCart} onUpdateQuantity={updateQuantity} />
); }; export default App;
top of page
bottom of page