mirror of
https://github.com/supabase/supabase.git
synced 2026-06-09 11:38:49 +08:00
* Update dropzone component for UI Library * Replace text-foreground-light with text-muted-foreground (standard var in shadcn). Refactor isSuccess to be a memoized value. * Revert the shadcn button to the original. --------- Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
30 lines
645 B
TypeScript
30 lines
645 B
TypeScript
'use client'
|
|
|
|
import {
|
|
Dropzone,
|
|
DropzoneContent,
|
|
DropzoneEmptyState,
|
|
} from '@/registry/default/blocks/dropzone/components/dropzone'
|
|
import { useSupabaseUpload } from '@/registry/default/blocks/dropzone/hooks/use-supabase-upload'
|
|
|
|
const FileUploadDemo = () => {
|
|
const props = useSupabaseUpload({
|
|
bucketName: 'test',
|
|
path: 'test',
|
|
allowedMimeTypes: ['image/*'],
|
|
maxFiles: 2,
|
|
maxFileSize: 1000 * 1000 * 10, // 10MB,
|
|
})
|
|
|
|
return (
|
|
<div className="w-[500px]">
|
|
<Dropzone {...props}>
|
|
<DropzoneEmptyState />
|
|
<DropzoneContent />
|
|
</Dropzone>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default FileUploadDemo
|