import type { IUserHasId } from '@growi/core'; import { useTranslation } from 'next-i18next'; import { apiv3Post } from '~/client/util/apiv3-client'; import { toastError } from '~/client/util/toastr'; import { useCurrentUser } from '~/stores-universal/context'; type Props = { currentUser: IUserHasId, }; export const Maintenance = (props: Props): JSX.Element => { const { t } = useTranslation(); useCurrentUser(props.currentUser ?? null); const logoutHandler = async() => { try { await apiv3Post('/logout'); window.location.reload(); } catch (err) { toastError(err); } }; return (
arrow_circle_right { t('maintenance_mode.admin_page') }
)} {props.currentUser != null ? (arrow_circle_right { t('maintenance_mode.logout') }
) : (arrow_circle_right { t('maintenance_mode.login') }
) }