import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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: 'Unexpected Error',
        error_desc: 'An error occured and your request cannot be completed.',
        should_do: 'You might check the url, or contact your admin if the error remains.',
        return_home: 'Return Home',
        may_also_contact: 'You may also contact ',
        to_report_issue: ' to report this issue.',
    },
    fr: {
        unexpected_error: 'Erreur inattendue',
        error_desc: "Une erreur s'est produite et votre demande ne peut être complétée.",
        should_do: "Vous pouvez vérifier l'url, ou contacter votre administrateur si l'erreur persiste.",
        return_home: "Retour à l'accueil",
        may_also_contact: 'Vous pouvez également contacter le ',
        to_report_issue: ' pour signaler le problème.',
    },
};
function ErrorPage500({ supportLink = undefined, locale = 'en', onReturnHomeClick, errorMessage, ...rest }) {
    if (!translations[locale])
        locale = 'en';
    // Ensure the locale formatting is consistent
    locale = locale.toLowerCase();
    return (_jsxs(ErrorPageContainer, { className: "sc-error-page500", ...rest, children: [_jsxs(Row, { children: [_jsx(Icon, { name: "Exclamation-triangle", size: "2x", color: "statusWarning" }), _jsx(Title, { children: translations[locale].unexpected_error })] }), _jsx(Row, { children: _jsxs(Description, { children: [_jsx(DescriptionContent, { children: errorMessage
                                ? errorMessage[locale]
                                : translations[locale].error_desc }), _jsx(DescriptionContent, { children: translations[locale].should_do }), supportLink && (_jsxs(DescriptionContent, { children: [translations[locale].may_also_contact, _jsxs(Link, { href: supportLink, children: ["support ", _jsx(Icon, { name: "External-link" })] }), translations[locale].to_report_issue] }))] }) }), onReturnHomeClick && (_jsx(Button, { label: translations[locale].return_home, variant: "secondary", onClick: onReturnHomeClick }))] }));
}
export { ErrorPage500 };
