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 TextOverlaySettings() { const { files } = useFileStore(); const { processFiles, processing, error, downloadUrl, originalSize, processedSize, progress } = useToolProcessor("text-overlay"); const [text, setText] = useState("Your Text Here"); const [fontSize, setFontSize] = useState(48); const [color, setColor] = useState("#FFFFFF"); const [position, setPosition] = useState<"top" | "center" | "bottom">("bottom"); const [backgroundBox, setBackgroundBox] = useState(false); const [backgroundColor, setBackgroundColor] = useState("#000000"); const [shadow, setShadow] = useState(true); const handleProcess = () => { processFiles(files, { text, fontSize, color, position, backgroundBox, backgroundColor, shadow }); }; const hasFile = files.length > 0; return (
setText(e.target.value)} className="w-full mt-0.5 px-2 py-1.5 rounded border border-border bg-background text-sm text-foreground" />
{fontSize}px
setFontSize(Number(e.target.value))} className="w-full mt-1" />
setColor(e.target.value)} className="w-full mt-0.5 h-8 rounded border border-border" />
{backgroundBox && (
setBackgroundColor(e.target.value)} className="w-full mt-0.5 h-8 rounded border border-border" />
)} {error &&

{error}

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

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

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

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