Add account/account.ftl to storybook

This commit is contained in:
garronej
2023-04-20 02:52:49 +02:00
parent 18112a97ab
commit e7bfe7f80d
7 changed files with 100 additions and 12 deletions

27
stories/account/KcApp.tsx Normal file
View File

@ -0,0 +1,27 @@
import React, { lazy, Suspense } from "react";
import Fallback from "../../dist/account";
import type { KcContext } from "./kcContext";
import { useI18n } from "./i18n";
const DefaultTemplate = lazy(() => import("../../dist/account/Template"));
export default function KcApp(props: { kcContext: KcContext }) {
const { kcContext } = props;
const i18n = useI18n({ kcContext });
if (i18n === null) {
return null;
}
return (
<Suspense>
{(() => {
switch (kcContext.pageId) {
default:
return <Fallback {...{ kcContext, i18n }} Template={DefaultTemplate} doUseDefaultCss={true} />;
}
})()}
</Suspense>
);
}