feat : update
This commit is contained in:
@@ -19,8 +19,10 @@ export interface UploadedMedia {
|
||||
|
||||
export function MediaUploader({
|
||||
onReady,
|
||||
onFileSelected,
|
||||
}: {
|
||||
onReady: (media: UploadedMedia) => void;
|
||||
onFileSelected?: (file: File) => void;
|
||||
}) {
|
||||
const inputId = useId();
|
||||
const [state, setState] = useState<"idle" | "uploading">("idle");
|
||||
@@ -67,7 +69,10 @@ export function MediaUploader({
|
||||
onChange={(event) => {
|
||||
const file = event.target.files?.[0];
|
||||
event.target.value = "";
|
||||
if (file) void upload(file);
|
||||
if (file) {
|
||||
onFileSelected?.(file);
|
||||
void upload(file);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
<Button
|
||||
|
||||
Reference in New Issue
Block a user