import { Icon, Button, PopupTrigger, Popup, Menu, Item, Text } from 'react-basics'; import { useRouter } from 'next/router'; import Icons from 'components/icons'; import useMessages from 'hooks/useMessages'; import useUser from 'hooks/useUser'; import useConfig from 'hooks/useConfig'; import styles from './ProfileButton.module.css'; import useLocale from 'hooks/useLocale'; export default function ProfileButton() { const { formatMessage, labels } = useMessages(); const { user } = useUser(); const { cloudMode } = useConfig(); const router = useRouter(); const { dir } = useLocale(); const handleSelect = key => { if (key === 'profile') { router.push('/settings/profile'); } if (key === 'logout') { router.push('/logout'); } }; return ( {user.username} {formatMessage(labels.profile)} {!cloudMode && ( {formatMessage(labels.logout)} )} ); }