import { useState } from "react"; import { ProgressCard } from "@/components/common/progress-card"; import { useTranslation } from "@/contexts/i18n-context"; import { useToolProcessor } from "@/hooks/use-tool-processor"; import { format } from "@/lib/format"; import { useFileStore } from "@/stores/file-store"; export function WaveformImageSettings() { const { t } = useTranslation(); const s = t.toolSettings["waveform-image"]; const { files } = useFileStore(); const { processFiles, processAllFiles, processing, error, progress } = useToolProcessor("waveform-image"); const [width, setWidth] = useState(1024); const [height, setHeight] = useState(256); const [color, setColor] = useState("#4f46e5"); const hasFile = files.length > 0; const hasMultiple = files.length > 1; const handleProcess = () => { const settings = { width, height, color }; if (hasMultiple) { processAllFiles(files, settings); } else { processFiles(files, settings); } }; return (
setWidth(Number(e.target.value))} className="w-full mt-0.5 px-2 py-1.5 rounded border border-border bg-background text-sm text-foreground" />
setHeight(Number(e.target.value))} className="w-full mt-0.5 px-2 py-1.5 rounded border border-border bg-background text-sm text-foreground" />
setColor(e.target.value)} className="w-full mt-0.5 px-2 py-1.5 rounded border border-border bg-background text-sm text-foreground" />
{error &&

{error}

} {processing ? ( ) : ( )}
); }