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"; type Quality = "light" | "balanced" | "strong"; type Resolution = "original" | "1080p" | "720p" | "480p"; export function CompressVideoSettings() { const { t } = useTranslation(); const s = t.toolSettings["compress-video"]; const { files } = useFileStore(); const { processFiles, processAllFiles, processing, error, progress } = useToolProcessor("compress-video"); const [quality, setQuality] = useState("balanced"); const [resolution, setResolution] = useState("original"); const hasFile = files.length > 0; const hasMultiple = files.length > 1; const handleProcess = () => { const settings = { quality, resolution }; if (hasMultiple) { processAllFiles(files, settings); } else { processFiles(files, settings); } }; return (
{error &&

{error}

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