66 lines
2.2 KiB
TypeScript
66 lines
2.2 KiB
TypeScript
// This file is auto-generated by the `update-kc-gen` command. Do not edit it manually.
|
|
// Hash: 822f146dfd89023346d41d4f77fba9745b7f55365c95ca37f85806c01ab23dc4
|
|
|
|
/* eslint-disable */
|
|
|
|
// @ts-nocheck
|
|
|
|
// noinspection JSUnusedGlobalSymbols
|
|
|
|
import { lazy, Suspense, type ReactNode } from "react";
|
|
|
|
export type ThemeName = "keycloakify-starter";
|
|
|
|
export const themeNames: ThemeName[] = ["keycloakify-starter"];
|
|
|
|
export type KcEnvName = never;
|
|
|
|
export const kcEnvNames: KcEnvName[] = [];
|
|
|
|
export const kcEnvDefaults: Record<KcEnvName, string> = {};
|
|
|
|
/**
|
|
* NOTE: Do not import this type except maybe in your entrypoint.
|
|
* If you need to import the KcContext import it either from src/login/KcContext.ts or src/account/KcContext.ts.
|
|
* Depending on the theme type you are working on.
|
|
*/
|
|
export type KcContext =
|
|
| import("./login/KcContext").KcContext
|
|
| import("./account/KcContext").KcContext
|
|
| import("./admin/KcContext").KcContext;
|
|
|
|
declare global {
|
|
interface Window {
|
|
kcContext?: KcContext;
|
|
}
|
|
}
|
|
|
|
export const KcLoginPage = lazy(() => import("./login/KcPage"));
|
|
export const KcAccountPage = lazy(() => import("./account/KcPage"));
|
|
export const KcAdminPage = lazy(() => import("./admin/KcPage"));
|
|
|
|
export function KcPage(props: { kcContext: KcContext; fallback?: ReactNode }) {
|
|
const { kcContext, fallback } = props;
|
|
return (
|
|
<Suspense fallback={fallback}>
|
|
{(() => {
|
|
switch (kcContext.themeType) {
|
|
case "login":
|
|
return <KcLoginPage kcContext={kcContext} />;
|
|
case "account":
|
|
return <KcAccountPage kcContext={kcContext} />;
|
|
case "admin":
|
|
return <KcAdminPage kcContext={kcContext} />;
|
|
}
|
|
})()}
|
|
</Suspense>
|
|
);
|
|
}
|
|
|
|
// NOTE: This is exported here only because in Webpack environnement it works differently
|
|
export const BASE_URL = import.meta.env.BASE_URL;
|
|
|
|
// NOTE: This is only exported here because you're supposed to import type from different packages
|
|
// Depending of if you are using Vite, Webpack, ect...
|
|
export type { Meta, StoryObj } from "@storybook/react-vite";
|