"use client"; import { ThemeProvider } from "@/providers/themeProvider/ThemeProvider"; import { useState } from "react"; import NavbarStyleCentered from '@/components/navbar/NavbarStyleCentered/NavbarStyleCentered'; import HeroBillboardGallery from '@/components/sections/hero/HeroBillboardGallery'; import ProductCardOne from '@/components/sections/product/ProductCardOne'; import SplitAboutMetric from '@/components/sections/about/SplitAboutMetric'; import FeatureCardTwentyOne from '@/components/sections/feature/FeatureCardTwentyOne'; import MetricCardEleven from '@/components/sections/metrics/MetricCardEleven'; import TeamCardSix from '@/components/sections/team/TeamCardSix'; import TestimonialCardFive from '@/components/sections/testimonial/TestimonialCardFive'; import ContactCenterForm from '@/components/sections/contact/ContactCenterForm'; import FooterBaseCard from '@/components/sections/footer/FooterBaseCard'; import { Sparkles, Star, Users, ShoppingCart, X } from "lucide-react"; interface CartItem { id: string; name: string; price: string; imageSrc: string; imageAlt: string; quantity: number; } export default function LandingPage() { const [cartItems, setCartItems] = useState([]); const [showCart, setShowCart] = useState(false); const handleAddToCart = (productId: string, productName: string, productPrice: string, productImage: string, productAlt: string) => { setCartItems(prevItems => { const existingItem = prevItems.find(item => item.id === productId); if (existingItem) { return prevItems.map(item => item.id === productId ? { ...item, quantity: item.quantity + 1 } : item ); } return [...prevItems, { id: productId, name: productName, price: productPrice, imageSrc: productImage, imageAlt: productAlt, quantity: 1 }]; }); }; const handleRemoveFromCart = (productId: string) => { setCartItems(prevItems => prevItems.filter(item => item.id !== productId)); }; const handleUpdateQuantity = (productId: string, quantity: number) => { if (quantity <= 0) { handleRemoveFromCart(productId); } else { setCartItems(prevItems => prevItems.map(item => item.id === productId ? { ...item, quantity } : item ) ); } }; const totalItems = cartItems.reduce((sum, item) => sum + item.quantity, 0); return ( {/* Shopping Cart Modal */} {showCart && (

Shopping Cart ({totalItems})

{cartItems.length === 0 ? (

Your cart is empty

) : (
{cartItems.map(item => (
{item.imageAlt}

{item.name}

{item.price}

{item.quantity}
))}
)}
)}
{/* Add to Cart buttons for products - inline UI as workaround */}
{/* Cart Button */}
); }