import { useState } from "react"; import { useFileStore } from "@/stores/file-store"; import { useToolProcessor } from "@/hooks/use-tool-processor"; import { Download, Loader2 } from "lucide-react"; export function StripMetadataSettings() { const { files } = useFileStore(); const { processFiles, processing, error, downloadUrl, originalSize, processedSize } = useToolProcessor("strip-metadata"); const [stripAll, setStripAll] = useState(true); const [stripExif, setStripExif] = useState(false); const [stripGps, setStripGps] = useState(false); const [stripIcc, setStripIcc] = useState(false); const [stripXmp, setStripXmp] = useState(false); const handleStripAllChange = (checked: boolean) => { setStripAll(checked); if (checked) { setStripExif(false); setStripGps(false); setStripIcc(false); setStripXmp(false); } }; const handleProcess = () => { processFiles(files, { stripAll, stripExif, stripGps, stripIcc, stripXmp }); }; const hasFile = files.length > 0; return (
{error}
} {/* Size info */} {originalSize != null && processedSize != null && (Original: {(originalSize / 1024).toFixed(1)} KB
Processed: {(processedSize / 1024).toFixed(1)} KB
Metadata removed: {((originalSize - processedSize) / 1024).toFixed(1)} KB