mirror of
https://github.com/pterodactyl/panel.git
synced 2026-12-05 05:45:46 -05:00
46 lines
1.9 KiB
TypeScript
46 lines
1.9 KiB
TypeScript
import { Button, PanelLink } from '@/sdk';
|
|
import type { ViewProps } from '@/sdk/theme';
|
|
import { TextField } from '../shared/fields';
|
|
import AuthCard, { authLinkClass } from './AuthCard';
|
|
|
|
export default function CheckpointPage({ model, className }: ViewProps<'page.auth.checkpoint'>) {
|
|
const { recovery } = model;
|
|
|
|
return (
|
|
<AuthCard title='Device Checkpoint' submit={model.submit} className={className}>
|
|
<div className='mt-6'>
|
|
<TextField
|
|
field={model.fields.code}
|
|
light
|
|
title={recovery ? 'Recovery Code' : 'Authentication Code'}
|
|
description={
|
|
recovery
|
|
? 'Enter one of the recovery codes generated when you setup 2-Factor authentication on this account in order to continue.'
|
|
: 'Enter the two-factor token generated by your device.'
|
|
}
|
|
autoFocus
|
|
/>
|
|
</div>
|
|
<div className='mt-6'>
|
|
<Button type='submit' size='xlarge' disabled={!model.canSubmit} isLoading={model.submitting}>
|
|
Continue
|
|
</Button>
|
|
</div>
|
|
<div className='mt-6 text-center'>
|
|
<button
|
|
type='button'
|
|
onClick={model.toggleRecovery}
|
|
className='cursor-pointer appearance-none border-0 bg-transparent p-0 text-xs text-muted-foreground tracking-wide uppercase no-underline hover:text-foreground'
|
|
>
|
|
{recovery ? 'I Have My Device' : "I've Lost My Device"}
|
|
</button>
|
|
</div>
|
|
<div className='mt-6 text-center'>
|
|
<PanelLink destination={model.login} className={authLinkClass}>
|
|
Return to Login
|
|
</PanelLink>
|
|
</div>
|
|
</AuthCard>
|
|
);
|
|
}
|