MCPcopy Create free account
hub / github.com/OpenSignLabs/OpenSign / handleFileChange

Function handleFileChange

apps/OpenSign/src/pages/DebugPdf.jsx:198–212  ·  view source on GitHub ↗
(files)

Source from the content-addressed store, hash-verified

196 }, 1500); // Reset copied state after 1.5 seconds
197 };
198 const handleFileChange = (files) => {
199 const file = files[0];
200 setPdf(file);
201
202 if (file && file.type === "application/pdf") {
203 const reader = new FileReader();
204
205 reader.onloadend = () => {
206 const base64String = reader.result.split(",")[1];
207 setPdfDetails((prevdata) => ({ ...prevdata, base64: base64String }));
208 };
209
210 reader.readAsDataURL(file);
211 }
212 };
213 const handleDelete = (key) => {
214 const updateAnnotations = annotations.filter((x) => x.key !== key);
215 setAnnotations(updateAnnotations);

Callers 1

DebugPdfFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected