import AccountManager from '@/components/AccountManager' import LoginDialog from '@/components/LoginDialog' import LogoutDialog from '@/components/LogoutDialog' import PubkeyCopy from '@/components/PubkeyCopy' import QrCodePopover from '@/components/QrCodePopover' import { Button } from '@/components/ui/button' import { Separator } from '@/components/ui/separator' import { SimpleUserAvatar } from '@/components/UserAvatar' import { SimpleUsername } from '@/components/Username' import PrimaryPageLayout from '@/layouts/PrimaryPageLayout' import { toProfile, toSettings } from '@/lib/link' import { cn } from '@/lib/utils' import { useSecondaryPage } from '@/PageManager' import { useNostr } from '@/providers/NostrProvider' import { ArrowDownUp, ChevronRight, LogOut, Settings, UserRound } from 'lucide-react' import { forwardRef, HTMLProps, useState } from 'react' import { useTranslation } from 'react-i18next' const MePage = forwardRef((_, ref) => { const { t } = useTranslation() const { push } = useSecondaryPage() const { pubkey } = useNostr() const [loginDialogOpen, setLoginDialogOpen] = useState(false) const [logoutDialogOpen, setLogoutDialogOpen] = useState(false) if (!pubkey) { return ( }>
) } return ( }>
push(toProfile(pubkey))}> {t('Profile')} setLoginDialogOpen(true)}> {t('Switch account')} setLogoutDialogOpen(true)} hideChevron > {t('Logout')}
) }) MePage.displayName = 'MePage' export default MePage function MePageTitlebar() { const { push } = useSecondaryPage() return (
) } function Item({ children, className, hideChevron = false, ...props }: HTMLProps & { hideChevron?: boolean }) { return (
{children}
{!hideChevron && }
) }