2023-04-20 01:53:36 +02:00
|
|
|
import React from "react";
|
2024-06-03 00:11:19 +02:00
|
|
|
import type { Meta, StoryObj } from "@storybook/react";
|
2024-06-09 11:53:25 +02:00
|
|
|
import { createKcPageStory } from "../KcPageStory";
|
2023-04-20 01:53:36 +02:00
|
|
|
|
2024-06-09 11:53:25 +02:00
|
|
|
const { KcPageStory } = createKcPageStory({ pageId: "error.ftl" });
|
2023-04-20 01:53:36 +02:00
|
|
|
|
2024-06-03 00:11:19 +02:00
|
|
|
const meta = {
|
2024-06-06 07:28:34 +02:00
|
|
|
title: "login/error.ftl",
|
2024-06-09 11:53:25 +02:00
|
|
|
component: KcPageStory
|
|
|
|
} satisfies Meta<typeof KcPageStory>;
|
2023-04-20 01:53:36 +02:00
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
2024-06-03 00:11:19 +02:00
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
|
|
export const Default: Story = {
|
2024-06-09 11:53:25 +02:00
|
|
|
render: () => <KcPageStory />
|
2024-06-03 00:11:19 +02:00
|
|
|
};
|
2023-04-20 01:53:36 +02:00
|
|
|
|
2024-06-03 00:11:19 +02:00
|
|
|
export const WithAnotherMessage: Story = {
|
|
|
|
render: () => (
|
2024-06-09 11:53:25 +02:00
|
|
|
<KcPageStory
|
2024-06-03 00:11:19 +02:00
|
|
|
kcContext={{
|
|
|
|
message: { summary: "With another error message" }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
};
|
2024-09-29 04:35:02 -04:00
|
|
|
|
|
|
|
export const WithHtmlErrorMessage: Story = {
|
|
|
|
render: () => (
|
|
|
|
<KcPageStory
|
|
|
|
kcContext={{
|
|
|
|
message: {
|
|
|
|
summary: "<strong>Error:</strong> Something went wrong. <a href='https://example.com'>Go back</a>"
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
};
|
|
|
|
export const FrenchError: Story = {
|
|
|
|
render: () => (
|
|
|
|
<KcPageStory
|
|
|
|
kcContext={{
|
|
|
|
locale: { currentLanguageTag: "fr" },
|
|
|
|
message: { summary: "Une erreur s'est produite" }
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
};
|
|
|
|
export const WithSkipLink: Story = {
|
|
|
|
render: () => (
|
|
|
|
<KcPageStory
|
|
|
|
kcContext={{
|
|
|
|
message: { summary: "An error occurred" },
|
|
|
|
skipLink: true,
|
|
|
|
client: {
|
|
|
|
baseUrl: "https://example.com"
|
|
|
|
}
|
|
|
|
}}
|
|
|
|
/>
|
|
|
|
)
|
|
|
|
};
|