import { Avatar } from '@langgenius/dify-ui/avatar' import { Button } from '@langgenius/dify-ui/button' import { useAtomValue } from 'jotai' import { useTranslation } from 'react-i18next' import { Triangle } from '@/app/components/base/icons/src/public/education' import { userProfileAtom } from '@/context/account-state' import { useRouter } from '@/next/navigation' import { useLogout } from '@/service/use-common' const UserInfo = () => { const router = useRouter() const { t } = useTranslation() const userProfile = useAtomValue(userProfileAtom) const { mutateAsync: logout } = useLogout() const handleLogout = async () => { await logout() // Tokens are now stored in cookies and cleared by backend router.push('/signin') } return (
{t(($) => $.currentSigned, { ns: 'education' })}
{userProfile.name}
{userProfile.email}
) } export default UserInfo