// @flow
import type { DropEvent, FileRejection } from 'react-dropzone';

export type Attachment = $Shape<File> & { name: string };

type OnDrop = (
  acceptedFiles: Attachment[],
  fileRejections?: FileRejection[],
  event?: DropEvent,
) => void;

export type FileUploaderProps = {|
  onDropAttachmentHandler: OnDrop,
  onClickRemoveHandler: (attachment: Attachment) => void,
  attachments: Attachment[],
  attachmentsError?: ?string,
  acceptedFileTypes: string,
  savePending: boolean,
  withoutFilesPrompt: string,
  withFilesPrompt: string,
  tip: string,
|};
