import { Film, Image } from "lucide-react"; import { useScopedT } from "@/contexts/I18nContext"; import type { ExportFormat } from "@/lib/exporter/types"; import { cn } from "@/lib/utils"; interface FormatSelectorProps { selectedFormat: ExportFormat; onFormatChange: (format: ExportFormat) => void; disabled?: boolean; } const formatOptions: Array<{ value: ExportFormat; icon: React.ReactNode }> = [ { value: "mp4", icon: }, { value: "gif", icon: }, ]; export function FormatSelector({ selectedFormat, onFormatChange, disabled = false, }: FormatSelectorProps) { const t = useScopedT("settings"); const formatLabels: Record = { mp4: { label: t("exportFormat.mp4Video"), description: t("exportFormat.mp4Description") }, gif: { label: t("exportFormat.gifAnimation"), description: t("exportFormat.gifDescription") }, }; return ( {formatOptions.map((option) => { const isSelected = selectedFormat === option.value; const labels = formatLabels[option.value]; return ( onFormatChange(option.value)} className={cn( "relative flex flex-col items-center gap-2 p-4 rounded-xl border transition-all duration-200", "focus:outline-none focus:ring-2 focus:ring-[#34B27B]/50 focus:ring-offset-2 focus:ring-offset-[#09090b]", isSelected ? "bg-[#34B27B]/10 border-[#34B27B]/50 text-white" : "bg-white/5 border-white/10 text-slate-400 hover:bg-white/10 hover:border-white/20 hover:text-slate-200", disabled && "opacity-50 cursor-not-allowed", )} > {option.icon} {labels.label} {labels.description} {isSelected && ( )} ); })} ); }