import { useStore } from '@nanostores/react'; import classNames from 'classnames'; import { useMemo } from 'react'; import { ClientOnly } from 'remix-utils/client-only'; import { useAuth } from '~/lib/hooks'; import { aiState } from '~/lib/stores/ai-state'; import { themeStore } from '~/lib/stores/theme'; import { HistorySwitch } from '../sidebar/HistorySwitch'; import { ThemeSwitch } from '../ui/ThemeSwitch'; import { ChatDescription } from './ChatDescription.client'; import { HeaderActionButtons } from './HeaderActionButtons'; import { MinimalAvatarDropdown } from './MinimalAvatarDropdown'; export function Header() { const { isAuthenticated } = useAuth(); const { chatStarted } = useStore(aiState); const theme = useStore(themeStore); const logoSrc = useMemo(() => (theme === 'dark' ? '/logo-dark.png' : '/logo.png'), [theme]); return ( <>
UPage Logo
{isAuthenticated && }
{chatStarted && {() => }}
{chatStarted && ( <> {() => (
)}
)}
); }