Generate upload thumbnails with File object and show upload status
npm install use-thumbnail-generatorFile object. The thumbnail is generated using the data url.Using this hook is very simple. You just need to pass the list of File and the uploadService function to generate thumbnails with upload pre
ogres.
Hook will return the list of IThumb objects. Each object will contain the thumbnail data url, the original file, upload progress, and the upload status.
``typescript`
export interface IThumb {
url: string;
id: string;
status: UploadStatus;
file: File | null;
uploadProgress: number;
responseUrl?: string;
signal?: AbortController;
}IThumb
You can use the object to display the thumbnail, upload progress, and the upload status. You can customize the UI based on the upload status.
Installation
`bash``
npm install use-thumbnail-generator --saveor with yarn
yarn add use-thumbnail-generatoror with bun
bun add use-thumbnail-generator
With Dropzone, number-flow and AutoAnimate