2021-03-03 00:04:06 +01:00
|
|
|
|
|
|
|
import { memo } from "react";
|
|
|
|
import { kcContext } from "../kcContext";
|
2021-03-04 21:14:54 +01:00
|
|
|
import { assert } from "../tools/assert";
|
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-03-06 14:42:56 +01:00
|
|
|
import { Info } from "./Info";
|
2021-03-03 00:04:06 +01:00
|
|
|
|
|
|
|
|
2021-03-06 14:42:56 +01:00
|
|
|
export const KcApp = memo((props: KcProps) => {
|
2021-03-03 00:04:06 +01:00
|
|
|
|
|
|
|
assert(kcContext !== undefined, "App is not currently served by a Keycloak server");
|
|
|
|
|
2021-03-06 22:41:36 +01:00
|
|
|
switch (kcContext.pageId) {
|
2021-03-06 14:42:56 +01:00
|
|
|
case "login.ftl": return <Login {...props} />;
|
|
|
|
case "register.ftl": return <Register {...props} />;
|
|
|
|
case "info.ftl": return <Info {...props} />;
|
2021-03-03 00:04:06 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
});
|