import { useState } from "react"; import { useFileStore } from "@/stores/file-store"; import { useToolProcessor } from "@/hooks/use-tool-processor"; import { Download } from "lucide-react"; import { ProgressCard } from "@/components/common/progress-card"; export function StripMetadataSettings() { const { files } = useFileStore(); const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } = 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; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (hasFile && !processing) handleProcess(); }; return (
{/* Strip All */}
{/* Individual options */}
{/* Error */} {error &&

{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

)} {/* Process */} {processing ? ( ) : ( )} {/* Download */} {downloadUrl && ( Download )} ); }