"use client"; import React, { useEffect, useState } from "react"; import { Navbar, NavbarContent, NavbarItem, NavbarMenuToggle, NavbarMenu, NavbarMenuItem, Button, } from "@nextui-org/react"; import { useTranslation } from "@/shared/lib/useTranslation"; import { useAuth } from "@/shared/lib/useAuth"; import { ArrowRightIcon } from "lucide-react"; import { DynamicLogo } from "@/shared/components/DynamicLogo"; import Link from "next/link"; import { useSharedStore } from "../store/share"; export type NavigationItem = { label: string; href: string; target?: string; }; interface NavigationProps { items?: NavigationItem[]; langNode?: React.ReactNode; navbarBrand?: React.ReactNode; onLogin?: () => void; classNames?: { logo?: string; }; signinText?: string; } // Client-side wrapper for interactive functionality function NavigationClient({ items = [], langNode, navbarBrand, onLogin, classNames, signinText = "Get Started", }: NavigationProps) { const [isMenuOpen, setIsMenuOpen] = useState(false); const { t } = useTranslation(); const { handleLogin } = useAuth(); const [userToken, setUserToken] = useState(null); useEffect(() => { const userToken = useSharedStore?.getState?.().user_token setUserToken(userToken); }, []); return ( <> {/* Main Navigation */}
{/* Logo using dynamic platform config */} {navbarBrand}
{/* Desktop Navigation */}
{items?.map((item) => ( {t(item.label)} ))}
{/* Right Side Actions */} {langNode ? ( langNode ) : ( <> { !userToken && ( <> ) } )} {/* Desktop Auth Button */}
{/* Mobile Auth Button */} {!langNode && (
)}
{/* Mobile Menu */} {items?.map((item, index) => ( {t(item.label)} ))}
); } // Export the client component export function Navigation(props: NavigationProps) { return ; }