import { useStore } from '@nanostores/react'; import { ClientOnly } from 'remix-utils/client-only'; import { chatStore } from '~/lib/stores/chat'; import { classNames } from '~/utils/classNames'; import { HeaderActionButtons } from './HeaderActionButtons.client'; import { ChatDescription } from '~/lib/persistence/ChatDescription.client'; import { useState } from 'react'; import { LoginDialog } from '~/components/auth/LoginDialog'; import { RegisterDialog } from '~/components/auth/RegisterDialog'; import { useAuth } from '~/hooks/useAuth'; import { UserMenu } from './UserMenu'; export function Header() { const chat = useStore(chatStore); const [isLoginOpen, setIsLoginOpen] = useState(false); const [isRegisterOpen, setIsRegisterOpen] = useState(false); const { isAuthenticated } = useAuth(); return (
多八多
{() => }
{chat.started && ( {() => (
)}
)} {isAuthenticated ? ( ) : ( <> )}
setIsLoginOpen(false)} /> setIsRegisterOpen(false)} />
); }