"use client"; import Image from "next/image"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Dispatch, SetStateAction, useMemo, useState } from "react"; import { FaRegUserCircle } from "react-icons/fa"; import { Currency } from "@appTypes/StoreModel"; import AuthModal from "@components/AuthModal"; import { useStoreActions, useStoreState } from "@hooks/store"; export default function Navbar({}: // currencySelector, { // currencySelector?: { selectedCurrency: string; setSelectedCurrency: Dispatch> }; }) { const pathname = usePathname(); const selectedCurrency = useStoreState((state) => state.currency.selectedCurrency); const setSelectedCurrency = useStoreActions((actions) => actions.currency.setSelectedCurrency); const navOptions = useMemo(() => ["Earthquakes", "Observatories", "Warehouse", "Shop"], []); // const navOptions = useMemo(() => ["Earthquakes"], []); const aboutDropdown = ["Contact Us", "Our Mission", "The Team"]; // { label: "Our Mission", path: "/our-mission" }, // { label: "The Team", path: "/the-team" }, // { label: "Contact Us", path: "/contact-us" }] const [isModalOpen, setIsModalOpen] = useState(false); const currencies = useStoreState((state) => state.currency.currencies); const currencyTickers = useStoreState((state) => state.currency.tickers); function NavbarButton({ name, href, dropdownItems }: { name: string; href: string; dropdownItems?: string[] }) { const isActive = dropdownItems ? dropdownItems.some((item) => pathname === `/${item.toLowerCase().replace(" ", "-")}`) : pathname === href; return ( ); } return (
Logo
{navOptions.map((name) => ( ))}
{pathname.includes("shop") && ( )} setIsModalOpen(false)} />
); }