42 lines
1.8 KiB
TypeScript
Raw Normal View History

2021-03-03 00:04:06 +01:00
import { memo } from "react";
2021-06-23 08:16:51 +02:00
import type { KcContextBase } from "../getKcContext/KcContextBase";
2021-03-06 14:42:56 +01:00
import type { KcProps } from "./KcProps";
2021-03-03 00:04:06 +01:00
import { Login } from "./Login";
2021-03-04 18:15:48 +01:00
import { Register } from "./Register";
2021-10-11 03:25:02 +02:00
import { RegisterUserProfile } from "./RegisterUserProfile";
2021-03-06 14:42:56 +01:00
import { Info } from "./Info";
2021-03-07 14:57:53 +01:00
import { Error } from "./Error";
import { LoginResetPassword } from "./LoginResetPassword";
2021-03-07 15:37:37 +01:00
import { LoginVerifyEmail } from "./LoginVerifyEmail";
2021-04-08 15:41:40 +02:00
import { Terms } from "./Terms";
2021-06-14 21:19:46 +02:00
import { LoginOtp } from "./LoginOtp";
import { LoginUpdateProfile } from "./LoginUpdateProfile";
import { LoginIdpLinkConfirm } from "./LoginIdpLinkConfirm";
2021-03-03 00:04:06 +01:00
export const KcApp = memo(({ kcContext, ...props }: { kcContext: KcContextBase } & KcProps) => {
switch (kcContext.pageId) {
case "login.ftl":
return <Login {...{ kcContext, ...props }} />;
case "register.ftl":
return <Register {...{ kcContext, ...props }} />;
case "register-user-profile.ftl":
return <RegisterUserProfile {...{ kcContext, ...props }} />;
case "info.ftl":
return <Info {...{ kcContext, ...props }} />;
case "error.ftl":
return <Error {...{ kcContext, ...props }} />;
case "login-reset-password.ftl":
return <LoginResetPassword {...{ kcContext, ...props }} />;
case "login-verify-email.ftl":
return <LoginVerifyEmail {...{ kcContext, ...props }} />;
case "terms.ftl":
return <Terms {...{ kcContext, ...props }} />;
case "login-otp.ftl":
return <LoginOtp {...{ kcContext, ...props }} />;
case "login-update-profile.ftl":
return <LoginUpdateProfile {...{ kcContext, ...props }} />;
case "login-idp-link-confirm.ftl":
return <LoginIdpLinkConfirm {...{ kcContext, ...props }} />;
}
});