import CardDecorator from "@saleor/storybook/CardDecorator"; import Decorator from "@saleor/storybook/Decorator"; import { storiesOf } from "@storybook/react"; import React, { useState } from "react"; import FileUploadField, { FileUploadFieldProps } from "./FileUploadField"; import * as fixtures from "./fixtures"; const props: FileUploadFieldProps = { disabled: false, file: { label: undefined, value: undefined }, inputProps: { name: "country", placeholder: "Select country" }, loading: false, onFileDelete: () => undefined, onFileUpload: () => undefined }; const InteractiveStory: React.FC = () => { const [file, setFile] = useState(); return ( setFile(file)} onFileDelete={() => setFile(null)} /> ); }; storiesOf("Generics / File upload field", module) .addDecorator(CardDecorator) .addDecorator(Decorator) .add("default", () => ) .add("with ready to upload file", () => ( )) .add("with uploaded file", () => ( )) .add("with error", () => ( )) .add("interactive", () => );