import type { Meta, StoryObj } from '@storybook/react';
import { fn } from '@storybook/test';

import Upload from '.';
import { MAX_SIZE_DEFAULT } from './Upload';

const meta = {
  component: Upload,
  title: 'Forms/Upload',
  tags: ['autodocs'],
  argTypes: {
    maxSize: {
      control: {
        type: 'number',
        min: 0,
      },
    },
  },
} satisfies Meta<typeof Upload>;

export default meta;
type Story = StoryObj<typeof meta>;

export const Basic = {
  args: {
    maxSize: MAX_SIZE_DEFAULT,
    usAccept: 'image/*',
    usLabel: 'Front of your ID document',
    usDisabled: false,
    httpOptions: {
      url: 'https://httpbin.org/post',
      method: 'POST',
    },
    onStart: fn(),
    onSuccess: fn(),
    onFailure: fn(),
    onCancel: fn(),
  },
} satisfies Story;
