import { Download } from "lucide-react"; 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 { useFileStore } from "@/stores/file-store"; export function DuotoneSettings() { const { t } = useTranslation(); const { files } = useFileStore(); const { processFiles, processAllFiles, processing, error, downloadUrl, progress } = useToolProcessor("duotone"); const [shadow, setShadow] = useState("#1e3a8a"); const [highlight, setHighlight] = useState("#fbbf24"); const handleProcess = () => { const settings = { shadow, highlight }; if (files.length > 1) { processAllFiles(files, settings); } else { processFiles(files, settings); } }; const hasFile = files.length > 0; const canProcess = hasFile && !processing; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); if (canProcess) handleProcess(); }; return (
{/* Shadow Color */}
setShadow(e.target.value)} className="w-8 h-8 rounded border border-border shrink-0" /> setShadow(e.target.value)} className="flex-1 px-2 py-1 rounded border border-border bg-background text-xs text-foreground font-mono" />
{/* Highlight Color */}
setHighlight(e.target.value)} className="w-8 h-8 rounded border border-border shrink-0" /> setHighlight(e.target.value)} className="flex-1 px-2 py-1 rounded border border-border bg-background text-xs text-foreground font-mono" />
{error &&

{error}

} {processing ? ( ) : ( )} {downloadUrl && ( {t.common.download} )} ); }