2023-03-19 16:28:38 +01:00
|
|
|
import { assert } from "keycloakify/tools/assert";
|
2023-03-19 23:12:45 +01:00
|
|
|
import { type PageProps } from "keycloakify/login/pages/PageProps";
|
2023-03-18 18:27:50 +01:00
|
|
|
import type { KcContext } from "../kcContext";
|
2023-03-18 18:54:33 +01:00
|
|
|
import type { I18n } from "../i18n";
|
2021-03-06 14:42:56 +01:00
|
|
|
|
2023-03-18 06:14:05 +01:00
|
|
|
export default function Info(props: PageProps<Extract<KcContext, { pageId: "info.ftl" }>, I18n>) {
|
|
|
|
const { kcContext, i18n, doUseDefaultCss, Template, classes } = props;
|
2022-10-13 11:58:31 +02:00
|
|
|
|
|
|
|
const { msgStr, msg } = i18n;
|
|
|
|
|
|
|
|
assert(kcContext.message !== undefined);
|
|
|
|
|
|
|
|
const { messageHeader, message, requiredActions, skipLink, pageRedirectUri, actionUri, client } = kcContext;
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Template
|
2023-03-18 06:14:05 +01:00
|
|
|
{...{ kcContext, i18n, doUseDefaultCss, classes }}
|
2022-10-13 11:58:31 +02:00
|
|
|
displayMessage={false}
|
|
|
|
headerNode={messageHeader !== undefined ? <>{messageHeader}</> : <>{message.summary}</>}
|
2023-03-21 02:36:13 +01:00
|
|
|
>
|
|
|
|
<div id="kc-info-message">
|
|
|
|
<p className="instruction">
|
|
|
|
{message.summary}
|
2022-10-13 11:58:31 +02:00
|
|
|
|
2023-03-21 02:36:13 +01:00
|
|
|
{requiredActions !== undefined && (
|
|
|
|
<b>{requiredActions.map(requiredAction => msgStr(`requiredAction.${requiredAction}` as const)).join(",")}</b>
|
|
|
|
)}
|
|
|
|
</p>
|
|
|
|
{!skipLink && pageRedirectUri !== undefined ? (
|
|
|
|
<p>
|
|
|
|
<a href={pageRedirectUri}>{msg("backToApplication")}</a>
|
2022-10-13 11:58:31 +02:00
|
|
|
</p>
|
2023-03-21 02:36:13 +01:00
|
|
|
) : actionUri !== undefined ? (
|
|
|
|
<p>
|
|
|
|
<a href={actionUri}>{msg("proceedWithAction")}</a>
|
|
|
|
</p>
|
|
|
|
) : (
|
|
|
|
client.baseUrl !== undefined && (
|
2022-10-13 11:58:31 +02:00
|
|
|
<p>
|
2023-03-21 02:36:13 +01:00
|
|
|
<a href={client.baseUrl}>{msg("backToApplication")}</a>
|
2022-10-13 11:58:31 +02:00
|
|
|
</p>
|
2023-03-21 02:36:13 +01:00
|
|
|
)
|
|
|
|
)}
|
|
|
|
</div>
|
|
|
|
</Template>
|
2022-10-13 11:58:31 +02:00
|
|
|
);
|
2023-02-25 18:11:23 +01:00
|
|
|
}
|