saleor-dashboard/src/webhooks/components/WebhooksDetailsPage/WebhooksDetailsPage.stories.tsx

38 lines
975 B
TypeScript
Raw Normal View History

2019-10-10 12:48:19 +00:00
import { storiesOf } from "@storybook/react";
import React from "react";
import Decorator from "@saleor/storybook/Decorator";
import { formError } from "@saleor/storybook/misc";
import WebhooksDetailsPage, {
WebhooksDetailsPageProps
} from "./WebhooksDetailsPage";
const props: WebhooksDetailsPageProps = {
disabled: false,
errors: [],
2019-10-17 11:59:18 +00:00
fetchServiceAccounts: () => undefined,
2019-10-10 12:48:19 +00:00
onBack: () => undefined,
onDelete: () => undefined,
onSubmit: () => undefined,
saveButtonBarState: "default",
services: [],
webhook: null
2019-10-10 12:48:19 +00:00
};
2019-10-11 13:35:33 +00:00
storiesOf("Views / Webhook / Webhook details", module)
2019-10-10 12:48:19 +00:00
.addDecorator(Decorator)
.add("default", () => <WebhooksDetailsPage {...props} />)
.add("loading", () => (
<WebhooksDetailsPage
{...props}
webhook={undefined}
services={undefined}
disabled={true}
/>
2019-10-10 12:48:19 +00:00
))
.add("form errors", () => (
<WebhooksDetailsPage
{...props}
errors={["name"].map(field => formError(field))}
/>
));