mirror of
https://github.com/IRBorisov/ConceptPortal.git
synced 2025-06-26 13:00:39 +03:00
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
![]() |
import { useAuth } from '../context/AuthContext';
|
|||
|
import { useConceptNavigation } from '../context/NagivationContext';
|
|||
|
import TextURL from './Common/TextURL';
|
|||
|
|
|||
|
function ExpectedAnonymous() {
|
|||
|
const { user, logout } = useAuth();
|
|||
|
const { navigateTo } = useConceptNavigation();
|
|||
|
|
|||
|
function logoutAndRedirect() {
|
|||
|
logout(() => navigateTo('/login/'));
|
|||
|
}
|
|||
|
|
|||
|
return (
|
|||
|
<div className='flex flex-col items-center gap-3 py-6'>
|
|||
|
<p className='font-semibold'>{`Вы вошли в систему как ${user?.username ?? ''}`}</p>
|
|||
|
<div className='flex gap-3'>
|
|||
|
<TextURL text='Новая схема' href='/rsform-create'/>
|
|||
|
<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;
|