2023-12-13 14:32:57 +03:00
|
|
|
|
import { useAuth } from '@/context/AuthContext';
|
|
|
|
|
import { useConceptNavigation } from '@/context/NagivationContext';
|
|
|
|
|
|
2023-12-08 00:33:47 +03:00
|
|
|
|
import TextURL from './Common/TextURL';
|
|
|
|
|
|
|
|
|
|
function ExpectedAnonymous() {
|
|
|
|
|
const { user, logout } = useAuth();
|
2023-12-13 14:32:57 +03:00
|
|
|
|
const router = useConceptNavigation();
|
2023-12-08 00:33:47 +03:00
|
|
|
|
|
|
|
|
|
function logoutAndRedirect() {
|
2023-12-13 14:32:57 +03:00
|
|
|
|
logout(() => router.push('/login/'));
|
2023-12-08 00:33:47 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<div className='flex flex-col items-center gap-3 py-6'>
|
|
|
|
|
<p className='font-semibold'>{`Вы вошли в систему как ${user?.username ?? ''}`}</p>
|
|
|
|
|
<div className='flex gap-3'>
|
2023-12-13 14:32:57 +03:00
|
|
|
|
<TextURL text='Новая схема' href='/library/create'/>
|
2023-12-08 00:33:47 +03:00
|
|
|
|
<span> | </span>
|
|
|
|
|
<TextURL text='Библиотека' href='/library'/>
|
|
|
|
|
<span> | </span>
|
|
|
|
|
<TextURL text='Справка' href='/manuals'/>
|
|
|
|
|
<span> | </span>
|
|
|
|
|
<span
|
|
|
|
|
className='cursor-pointer hover:underline text-url'
|
|
|
|
|
onClick={logoutAndRedirect}
|
|
|
|
|
>
|
|
|
|
|
Выйти
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default ExpectedAnonymous;
|