feat: integrate S3 storage adapter and update file upload functionality
This commit is contained in:
@@ -21,7 +21,7 @@ import React, { useCallback } from 'react';
|
||||
|
||||
export interface FileUploadFieldProps {
|
||||
file: File | null;
|
||||
onFileChange: (file: File | null) => void;
|
||||
onFileChange: (file: File | null) => Promise<void>;
|
||||
accept?: string;
|
||||
validate?: (file: File) => string | null;
|
||||
onFileReject?: (file: File, message: string) => void;
|
||||
@@ -45,7 +45,8 @@ export const FileUploadField: React.FC<FileUploadFieldProps> = ({
|
||||
const handleAccept = useCallback(
|
||||
(files: File[]) => {
|
||||
const accepted = files[0];
|
||||
if (accepted) onFileChange(accepted);
|
||||
if (!accepted) return;
|
||||
onFileChange(accepted).then(() => {});
|
||||
},
|
||||
[onFileChange]
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user