import { useState } from 'react'; import { downloadImage } from '../imageUtils'; import type { WidgetTranslations } from '../i18n'; interface ResultViewProps { resultImage: string; originalClothingImage?: string; productTitle?: string; onTryAnother: () => void; onClose: () => void; t: WidgetTranslations['result']; } export function ResultView({ resultImage, originalClothingImage, productTitle, onTryAnother, onClose, t, }: ResultViewProps) { const [viewMode, setViewMode] = useState<'result' | 'compare'>('result'); const handleDownload = () => { const filename = `virtual-tryon-${productTitle?.replace(/\s+/g, '-').toLowerCase() || 'result'}-${Date.now()}.png`; downloadImage(resultImage, filename); }; return (