"use client"; import { X, Plus, Minus, ShoppingBag } from "lucide-react"; import { useCart } from "@/contexts/CartContext"; import { useLanguage } from "@/contexts/LanguageContext"; import { Button } from "@/components/ui/button"; import Link from "next/link"; export default function CartDrawer() { const { items, isCartOpen, setIsCartOpen, updateQuantity, removeItem, totalPrice, totalItems } = useCart(); const { t } = useLanguage(); if (!isCartOpen) return null; return ( <> {/* Overlay */}
setIsCartOpen(false)} /> {/* Drawer */}
{/* Header */}

{t("cart.title")} ({totalItems})

{/* Items */}
{items.length === 0 ? (

{t("cart.empty")}

) : (
{items.map((item) => (
{item.product.name}

{item.product.name}

{item.selectedColor} • {item.selectedLength}

{item.product.price} €

{item.quantity}
))}
)}
{/* Footer */} {items.length > 0 && (
{t("cart.total")} {totalPrice.toFixed(2)} €
setIsCartOpen(false)}>
)}
); };