ConceptPortal-public/rsconcept/frontend/src/components/ExpectedAnonymous.tsx
2023-12-08 00:33:47 +03:00

34 lines
1.0 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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;