"use client"; import { motion, AnimatePresence } from "framer-motion"; import { X } from "lucide-react"; import type { Product } from "@/lib/products"; import { useLanguage } from "@/context/language-context"; import Link from "next/link"; import { useProductStore } from "@/lib/productZustand"; import Image from "next/image"; import { usePathname } from "next/navigation"; interface ProductModalProps { product: Product; onClose: () => void; } export function ProductModal({ product, onClose }: ProductModalProps) { const { t, language } = useLanguage(); const setProductName = useProductStore((state) => state.setProductName); const languageIndex = language === "uz" ? true : false; const pathName = usePathname(); const isPathName = pathName === "/product"; return ( e.stopPropagation()} className="bg-white rounded-lg max-w-4xl w-full max-h-[90vh] overflow-y-auto" > {/* Header */}

{languageIndex ? product.name_uz : product.name_ru}

{/* Content */}
{/* Image */}
image
{/* Specifications */}

{t.features}

{product.features.map((spec, idx) => (
{languageIndex ? spec.key_uz : spec.key_ru}: {languageIndex ? spec.value_uz : spec.value_ru}
))}
{/* CTA Buttons */}
{ onClose(); setProductName( languageIndex ? product.name_uz : product.name_ru ); }} whileHover={{ scale: 1.05 }} whileTap={{ scale: 0.95 }} className="w-full px-6 py-3 bg-primary/80 text-white rounded-lg font-semibold hover:bg-primary transition-colors" > {t.contact.send}
{languageIndex ? product.description_uz : product.description_ru}
); }