import { ErrorPageContainer, Row, Title, Description, DescriptionContent, Link, } from './ErrorPageStyle'; import { Button } from '../buttonv2/Buttonv2.component'; import { Icon } from '../icon/Icon.component'; const translations = { en: { unexpected_error: 'Not authorized', error_desc: `You don't have permission to view this page using the credentials you have supplied.`, may_also_contact: 'You can contact ', to_report_issue: ' to report this issue.', return_home: 'Return Home', }, fr: { unexpected_error: `Accès refusé`, error_desc: `Les identifiants fournis ne vous permettent pas de consulter cette page.`, may_also_contact: 'Vous pouvez contacter le ', to_report_issue: ' pour signaler le problème.', return_home: "Retour à l'accueil", }, }; type Props = { supportLink?: string; locale?: string; onReturnHomeClick?: (event: React.MouseEvent) => void; }; function ErrorPage401({ supportLink = undefined, locale = 'en', onReturnHomeClick, ...rest }: Props) { if (!translations[locale]) locale = 'en'; // Ensure the locale formatting is consistent locale = locale.toLowerCase(); return ( {translations[locale].unexpected_error} {translations[locale].error_desc} {supportLink && ( {translations[locale].may_also_contact} support {translations[locale].to_report_issue} )} {onReturnHomeClick && (