MCPcopy Create free account
hub / github.com/dailydotdev/apps / handleFiles

Function handleFiles

packages/shared/src/components/buttons/UploadButton.tsx:24–39  ·  view source on GitHub ↗
(files: FileList | null)

Source from the content-addressed store, hash-verified

22 const { validateFiles } = useFileValidation(validation, errorMessages);
23
24 const handleFiles = (files: FileList | null) => {
25 if (!files || files.length === 0) {
26 return;
27 }
28
29 const { validFiles, errors } = validateFiles(files);
30
31 if (errors.length > 0) {
32 const first = errors[0];
33 const fileName = first.file ? ` (${first.file.name})` : '';
34 displayToast(`${first.message}${fileName}`);
35 return;
36 }
37
38 onFilesDrop(validFiles);
39 };
40
41 const { input, openFileInput } = useFileInput({
42 onFiles: handleFiles,

Callers

nothing calls this directly

Calls 2

validateFilesFunction · 0.85
displayToastFunction · 0.85

Tested by

no test coverage detected