import { Download } from "lucide-react"; import { useState } from "react"; import { ProgressCard } from "@/components/common/progress-card"; import { useToolProcessor } from "@/hooks/use-tool-processor"; import { useFileStore } from "@/stores/file-store"; export function BorderSettings() { const { files } = useFileStore(); const { processFiles, processAllFiles, processing, error, downloadUrl, originalSize, processedSize, progress, } = useToolProcessor("border"); const [borderWidth, setBorderWidth] = useState(10); const [borderColor, setBorderColor] = useState("#000000"); const [cornerRadius, setCornerRadius] = useState(0); const [padding, setPadding] = useState(0); const [shadowBlur, setShadowBlur] = useState(0); const handleProcess = () => { const settings = { borderWidth, borderColor, cornerRadius, padding, shadowBlur }; if (files.length > 1) { processAllFiles(files, settings); } else { processFiles(files, settings); } }; const hasFile = files.length > 0; return (
{borderWidth}px
setBorderWidth(Number(e.target.value))} className="w-full mt-1" />
setBorderColor(e.target.value)} className="w-full mt-0.5 h-8 rounded border border-border" />
{cornerRadius}px
setCornerRadius(Number(e.target.value))} className="w-full mt-1" />
{padding}px
setPadding(Number(e.target.value))} className="w-full mt-1" />
{shadowBlur}px
setShadowBlur(Number(e.target.value))} className="w-full mt-1" />
{error &&

{error}

} {originalSize != null && processedSize != null && (

Original: {(originalSize / 1024).toFixed(1)} KB

Processed: {(processedSize / 1024).toFixed(1)} KB

)} {processing ? ( ) : ( )} {downloadUrl && ( Download )}
); }