- Add session-aware login, logout and protected navigation. - Send cookie credentials for API and run-event requests with localized UI stories.
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
import { useTranslation } from 'react-i18next';
|
|
import { Button, ThemeSwitcher } from '../../ui';
|
|
import { usePageTitle } from '../../hooks/usePageTitle';
|
|
import liqaLogo from '../../assets/liqa.svg';
|
|
import styles from './AuthStatusPage.module.css';
|
|
|
|
export function AuthStatusPage({
|
|
failed = false,
|
|
onRetry,
|
|
}: {
|
|
failed?: boolean;
|
|
onRetry?: () => void;
|
|
}) {
|
|
const { t } = useTranslation();
|
|
usePageTitle(t('auth.page_title'));
|
|
return (
|
|
<div className={styles.page}>
|
|
<header className={styles.header}>
|
|
<img src={liqaLogo} alt="Liqa" className={styles.logo} />
|
|
<ThemeSwitcher />
|
|
</header>
|
|
<main className={styles.main} aria-live="polite">
|
|
{failed ? (
|
|
<section className={styles.message}>
|
|
<p role="alert">{t('auth.session_check_failed')}</p>
|
|
<Button type="button" size="lg" onClick={onRetry}>
|
|
{t('auth.retry')}
|
|
</Button>
|
|
</section>
|
|
) : (
|
|
<p className={styles.message} role="status">
|
|
{t('auth.checking_session')}
|
|
</p>
|
|
)}
|
|
</main>
|
|
</div>
|
|
);
|
|
}
|