import { route } from '@izzyjs/route/client'; import { Avatar, Group, Menu, Text, UnstyledButton } from '@mantine/core'; import { forwardRef } from 'react'; import { useTranslation } from 'react-i18next'; import { TbChevronRight } from 'react-icons/tb'; import useUser from '~/hooks/use_auth'; interface UserButtonProps extends React.ComponentPropsWithoutRef<'button'> { image: string; name: string; email: string; icon?: React.ReactNode; } const UserButton = forwardRef( ({ image, name, email, icon, ...others }: UserButtonProps, ref) => (
{name} {email}
{icon || }
) ); export function MantineUserCard() { const { t } = useTranslation('common'); const { user, isAuthenticated } = useUser(); return ( isAuthenticated && ( {t('logout')} ) ); }