@sb1/ffe-file-upload-react
Version:
Upload file button with validation and list of uploaded files.
19 lines (18 loc) • 723 B
TypeScript
import React from 'react';
export interface FileItemProps<Document> {
/** Shape of the file type, name is required, error and document.content is optional */
file: {
name: string;
document?: Document;
error?: string;
};
/**
* Called when the user clicks the delete button for a given file. Is called with the name of the file in question.
*/
onFileDeleted: React.MouseEventHandler<HTMLButtonElement>;
/** Label for the cancel button */
cancelText?: string;
/** Label for the delete button */
deleteText?: string;
}
export declare function FileItem<Document>({ file, onFileDeleted, cancelText, deleteText, }: FileItemProps<Document>): React.JSX.Element;