Files
supabase/apps/ui-library/registry/default/examples/dropzone-demo.tsx
Joshen Lim e0b2c605d2 Update dropzone component for UI Library (#34369)
* 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>
2025-03-25 15:37:22 +08:00

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