2025-02-10 01:32:16 +03:00
|
|
|
|
import { urls, useConceptNavigation } from '@/app';
|
2025-02-12 21:36:03 +03:00
|
|
|
|
|
2025-03-12 12:04:23 +03:00
|
|
|
|
import { TextURL } from '@/components/control';
|
2025-02-07 10:53:49 +03:00
|
|
|
|
|
2025-03-12 11:54:32 +03:00
|
|
|
|
import { useAuthSuspense } from '../backend/use-auth';
|
|
|
|
|
import { useLogout } from '../backend/use-logout';
|
2024-06-07 20:17:03 +03:00
|
|
|
|
|
2025-02-12 13:41:58 +03:00
|
|
|
|
export function ExpectedAnonymous() {
|
2025-01-29 16:17:50 +03:00
|
|
|
|
const { user } = useAuthSuspense();
|
2025-01-21 20:33:05 +03:00
|
|
|
|
const { logout } = useLogout();
|
2024-06-07 20:17:03 +03:00
|
|
|
|
const router = useConceptNavigation();
|
|
|
|
|
|
|
|
|
|
function logoutAndRedirect() {
|
2025-02-26 16:28:16 +03:00
|
|
|
|
void logout().then(() => router.push({ path: urls.login, force: true }));
|
2024-06-07 20:17:03 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
2024-12-12 13:17:24 +03:00
|
|
|
|
<div className='cc-fade-in flex flex-col items-center gap-3 py-6'>
|
2025-01-29 16:17:50 +03:00
|
|
|
|
<p className='font-semibold'>{`Вы вошли в систему как ${user.username}`}</p>
|
2024-06-07 20:17:03 +03:00
|
|
|
|
<div className='flex gap-3'>
|
|
|
|
|
<TextURL text='Новая схема' href='/library/create' />
|
|
|
|
|
<span> | </span>
|
|
|
|
|
<TextURL text='Библиотека' href='/library' />
|
|
|
|
|
<span> | </span>
|
|
|
|
|
<TextURL text='Справка' href='/manuals' />
|
|
|
|
|
<span> | </span>
|
2024-12-17 10:52:36 +03:00
|
|
|
|
<span className='cursor-pointer hover:underline text-sec-600' onClick={logoutAndRedirect}>
|
2024-06-07 20:17:03 +03:00
|
|
|
|
Выйти
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
}
|