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'; import { SubscriptionDialog } from '~/components/auth/SubscriptionDialog'; export function Header() { const chat = useStore(chatStore); const [isLoginOpen, setIsLoginOpen] = useState(false); const [isRegisterOpen, setIsRegisterOpen] = useState(false); const { isAuthenticated } = useAuth(); const [isSubscriptionOpen, setIsSubscriptionOpen] = useState(false); return (
多八多
{() => }
{chat.started && ( {() => (
)}
)} {isAuthenticated ? ( ) : ( <> )} {isAuthenticated && ( )}
setIsLoginOpen(false)} /> setIsRegisterOpen(false)} /> setIsSubscriptionOpen(false)} />
); }