kc.gen.tsx 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. // This file is auto-generated by the `update-kc-gen` command. Do not edit it manually.
  2. // Hash: b0aa286dba4ed04c111c1265bdb6a76ba45c22a3d9b9e8dcf36302267d40c51a
  3. /* eslint-disable */
  4. // @ts-nocheck
  5. // noinspection JSUnusedGlobalSymbols
  6. import { lazy, Suspense, type ReactNode } from "react";
  7. export type ThemeName = "keycloakify-starter";
  8. export const themeNames: ThemeName[] = ["keycloakify-starter"];
  9. export type KcEnvName = never;
  10. export const kcEnvNames: KcEnvName[] = [];
  11. export const kcEnvDefaults: Record<KcEnvName, string> = {};
  12. /**
  13. * NOTE: Do not import this type except maybe in your entrypoint.
  14. * If you need to import the KcContext import it either from src/login/KcContext.ts or src/account/KcContext.ts.
  15. * Depending on the theme type you are working on.
  16. */
  17. export type KcContext = import("./login/KcContext").KcContext;
  18. declare global {
  19. interface Window {
  20. kcContext?: KcContext;
  21. }
  22. }
  23. export const KcLoginPage = lazy(() => import("./login/KcPage"));
  24. export function KcPage(props: { kcContext: KcContext; fallback?: ReactNode }) {
  25. const { kcContext, fallback } = props;
  26. return (
  27. <Suspense fallback={fallback}>
  28. {(() => {
  29. switch (kcContext.themeType) {
  30. case "login":
  31. return <KcLoginPage kcContext={kcContext} />;
  32. }
  33. })()}
  34. </Suspense>
  35. );
  36. }
  37. // NOTE: This is exported here only because in Webpack environnement it works differently
  38. export const BASE_URL = import.meta.env.BASE_URL;
  39. // NOTE: This is only exported here because you're supposed to import type from different packages
  40. // Depending of if you are using Vite, Webpack, ect...
  41. export type { Meta, StoryObj } from "@storybook/react-vite";