import React from "react";
import { Meta, Story } from "@storybook/react";
import {
  MoleculePreviewFile,
  IPreviewFileProps,
} from "native/molecules/PreviewFile";

const meta: Meta = {
  title: "React Native/molecules/PreviewFile",
  component: MoleculePreviewFile,
  argTypes: {},
  parameters: {
    controls: { expanded: true },
  },
};

export default meta;

const TemplatePreviewFile: Story<IPreviewFileProps> = (props) => (
  <MoleculePreviewFile {...props} />
);

// By passing using the Args format for exported stories, you can control the props for a component for reuse in a test
// https://storybook.js.org/docs/react/workflows/unit-testing
export const PreviewFile = TemplatePreviewFile.bind({});

PreviewFile.args = {
  placeholder: "Select image...",
  acceptedFormatText: "JPG, PNG (Max size: 4 MB)",
  uploadIcon: true,
  onChange: () => console.log("Changed!"),
  onRemove: () => console.log("Removed!"),
  onError: () => console.log("Error"),
  placeholderProps: {
    size: "medium",
  },
};
