Complete migration of storybook from @lordvlad #274

This commit is contained in:
Joseph Garrone
2024-06-02 22:29:53 +02:00
parent 96a88fe865
commit f55a934939
6 changed files with 197 additions and 1 deletions

View File

@ -22,3 +22,24 @@ const meta: ComponentMeta<any> = {
export default meta;
export const Default = () => <PageStory />;
export const WithManualSetUp = () => (
<PageStory
kcContext={{
mode: "manual"
}}
/>
);
export const WithError = () => (
<PageStory
kcContext={{
messagesPerField: {
get: (fieldName: string) => (fieldName === "totp" ? "Invalid TOTP" : undefined),
exists: (fieldName: string) => fieldName === "totp",
existsError: (fieldName: string) => fieldName === "totp",
printIfExists: <T,>(fieldName: string, x: T) => (fieldName === "totp" ? x : undefined)
}
}}
/>
);