"use client"; import Image from "next/image"; import Link from "next/link"; import { Button } from "@/components/ui/button"; import { ChevronDown, Lock, Menu, X } from "lucide-react"; import { useEffect, useState } from "react"; import { usePathname } from "next/navigation"; import { AnimatePresence, motion } from "framer-motion"; import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogTrigger, } from "../ui/dialog"; import { Input } from "../ui/input"; import { Textarea } from "../ui/textarea"; export default function Navbar() { const pathname = usePathname(); const [open, setOpen] = useState(false); const [showProdukMenu, setShowProdukMenu] = useState(false); const [showPriceMenu, setShowPriceMenu] = useState(false); const [showServiceMenu, setShowServiceMenu] = useState(false); const [showAboutMenu, setShowAboutMenu] = useState(false); const [showConsumerMenu, setShowConsumerMenu] = useState(false); const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false); const isActive = (path: string) => pathname === path || pathname.startsWith(path + "/"); useEffect(() => { const handleClickOutside = () => { setShowProdukMenu(false); }; window.addEventListener("click", handleClickOutside); return () => window.removeEventListener("click", handleClickOutside); }, []); const produkList = [ { name: "JAECOO J7 AWD", img: "/j7awd.png", link: "/product/j7-awd", }, { name: "JAECOO J7 SHS", img: "/j7shs.png", link: "/product/j7-shs", }, { name: "JAECOO J8 AWD", img: "/j8awd.png", link: "/product/j8-awd", }, ]; const priceList = [ { name: "INFORMASI HARGA", link: "/price/price-information", }, { name: "PROMO", link: "/price/promo", }, ]; const serviceList = [ { name: "PROGRAM SERVICE", link: "/service/program-service", }, { name: "AFTER SALES", link: "/service/after-sales", }, ]; const aboutList = [ { name: "PROFILE", link: "/about/profile", }, { name: "SOCIAL MEDIA", link: "/about/sosmed", }, { name: "GALERY", link: "/about/galery", }, ]; const consumerList = [ { name: "AFTER SALES", link: "/customer-service/after-sales", }, { name: "SALES", link: "/customer-service/sales", }, ]; return (