import AttributePage, { AttributePageProps, } from "@saleor/attributes/components/AttributePage"; import { attribute } from "@saleor/attributes/fixtures"; import { AttributeErrorCode, AttributeInputTypeEnum } from "@saleor/graphql"; import { storiesOf } from "@storybook/react"; import React from "react"; import Decorator from "../../Decorator"; const props: AttributePageProps = { children: () => null, attribute, disabled: false, errors: [], onDelete: () => undefined, onSubmit: () => undefined, onValueAdd: () => undefined, onValueDelete: () => undefined, onValueReorder: () => undefined, onValueUpdate: () => undefined, saveButtonBarState: "default", values: attribute.choices, pageInfo: { hasNextPage: false, hasPreviousPage: false, }, onNextPage: () => undefined, onPreviousPage: () => undefined, }; storiesOf("Views / Attributes / Attribute details", module) .addDecorator(Decorator) .add("default", () => {() => null}) .add("loading", () => ( {() => null} )) .add("no values", () => ( {() => null} )) .add("form errors", () => ( ({ __typename: "AttributeError", code: AttributeErrorCode.INVALID, field, message: "Attribute code invalid", }))} > {() => null} )) .add("multiple select input", () => ( {() => null} )) .add("create", () => ( {() => null} ));