|
| 1 | +import { redirect } from 'next/navigation' |
| 2 | + |
| 3 | +import { View } from '@/app/components/ui/ukhsa' |
| 4 | +import UserSignIn from '@/app/components/ui/ukhsa/UserSignIn/UserSignIn' |
| 5 | +import { Heading } from '@/app/components/ui/ukhsa/View/Heading/Heading' |
| 6 | +import { getServerTranslation } from '@/app/i18n' |
| 7 | +import { PageComponentBaseProps } from '@/app/types' |
| 8 | +import { auth } from '@/auth' |
| 9 | + |
| 10 | +export default async function StartPage({ searchParams: { logout } }: PageComponentBaseProps<{ logout?: 'success' }>) { |
| 11 | + const session = await auth() |
| 12 | + |
| 13 | + if (session) redirect('/') |
| 14 | + |
| 15 | + const { t } = await getServerTranslation('auth') |
| 16 | + |
| 17 | + return ( |
| 18 | + <View> |
| 19 | + <div className="govuk-grid-row"> |
| 20 | + <div className="govuk-grid-column-three-quarters-from-desktop"> |
| 21 | + {logout === 'success' ? ( |
| 22 | + <div |
| 23 | + className="govuk-notification-banner govuk-notification-banner--success" |
| 24 | + role="alert" |
| 25 | + aria-labelledby="govuk-notification-banner-title" |
| 26 | + > |
| 27 | + <div className="govuk-notification-banner__header"> |
| 28 | + <h2 className="govuk-notification-banner__title" id="govuk-notification-banner-title"> |
| 29 | + {t('startPage.signOutBannerTitle')} |
| 30 | + </h2> |
| 31 | + </div> |
| 32 | + <div className="govuk-notification-banner__content"> |
| 33 | + <h3 className="govuk-notification-banner__heading">{t('startPage.signOutBannerHeading')}</h3> |
| 34 | + <p className="govuk-body">{t('startPage.signOutBannerDescription')}</p> |
| 35 | + </div> |
| 36 | + </div> |
| 37 | + ) : null} |
| 38 | + <Heading heading={t('startPage.heading')} /> |
| 39 | + <p>{t('startPage.intro')}</p> |
| 40 | + <p>{t('startPage.accessInfo')}</p> |
| 41 | + <p> |
| 42 | + <strong>{t('startPage.howToAccess')}</strong> |
| 43 | + </p> |
| 44 | + <ul className="govuk-list govuk-list--bullet"> |
| 45 | + <li>{t('startPage.steps.signIn')}</li> |
| 46 | + <li>{t('startPage.steps.contactAdmin')}</li> |
| 47 | + </ul> |
| 48 | + <UserSignIn /> |
| 49 | + </div> |
| 50 | + </div> |
| 51 | + </View> |
| 52 | + ) |
| 53 | +} |
0 commit comments