import { Home, User, LogIn, LogOut } from 'lucide-react'; import { Link, useNavigate } from '@tanstack/react-router' import { useLayoutStore } from '../store'; import { useShallow } from 'zustand/shallow'; import { useMemo } from 'react'; export const BaseHeader = (props: { main?: React.ComponentType | null }) => { const store = useLayoutStore(useShallow(state => ({ me: state.me, clearMe: state.clearMe, links: state.links, }))); const navigate = useNavigate(); const meInfo = useMemo(() => { if (!store.me) { return ( ) } return (
{store.me.avatar && ( Avatar )} {!store.me.avatar && (
)} {store.me?.username}
) }, [store.me, store.clearMe]) return ( <>
{ store.links.map(link => ( {link.key === 'home' && } {link.icon && {link.icon}} {link.title} )) }
{meInfo}

) } export const LayoutMain = () => { return }