'use client' import UserCenter from '@/components/composites/user-center' import {useClientStore, useProfileStore} from '@/app/stores' import {buttonVariants} from '@/components/ui/button' import { Navigation, NavigationIndicator, NavigationLink, NavigationLinkItem, NavigationGroup, NavigationTriggerItem, NavigationMenuViewport, } from '@/components/ui/navigation-menu' import Wrap from '@/components/wrap' import {merge} from '@/lib/utils' import {useState, useCallback, useEffect, useContext} from 'react' import Image from 'next/image' import logo from '@/assets/logo.webp' import ProductMenu, {Domestic} from '@/app/(home)/@header/_client/product' import SolutionMenu from '@/app/(home)/@header/_client/solution' import HelpMenu from '@/app/(home)/@header/_client/help' import {MenuIcon} from 'lucide-react' export type HeaderProps = {} export default function Header(props: HeaderProps) { // ====================== // 背景显示状态 // ====================== const [expand, setExpand] = useState(false) const [scroll, setScroll] = useState(false) const handleScroll = useCallback(() => { setScroll(window.scrollY > 48) }, []) useEffect(() => { setScroll(window.scrollY > 48) window.addEventListener('scroll', handleScroll) return () => { window.removeEventListener('scroll', handleScroll) } }, [handleScroll]) // ====================== // 移动端 // ====================== const lg = useClientStore(state => state.breakpoint.lg) // ====================== // render // ====================== return (
{ setExpand(!!value) }} >
{lg ? ( ) : ( } className={merge( `flex flex-col items-start gap-6`, )} > )} }/>
) } function AccountRegion() { const profile = useProfileStore(state => state.profile) return (
{profile ? ( ) : ( )}
) }