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 LqipPlaceholderSettings() { const { t } = useTranslation(); const { files } = useFileStore(); const { processFiles, processAllFiles, processing, error, downloadUrl, progress } = useToolProcessor("lqip-placeholder"); const [width, setWidth] = useState(16); const [blur, setBlur] = useState(2); const handleProcess = () => { const settings = { width, blur }; 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 (
{/* Width */}
{width}px
setWidth(Number(e.target.value))} className="w-full mt-1" />
{/* Blur */}
{blur}
setBlur(Number(e.target.value))} className="w-full mt-1" />

The base64 data URI will appear in the result envelope.

{error &&

{error}

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