import { useState } from 'react'; import type { CSSProperties } from 'react'; import type { ResultComparisonTranslations } from '../i18n/resultComparison'; interface ResultComparisonProps { resultImage: string; /** The shopper photo supplied to inference. */ originalPhotoImage?: string; /** The garment supplied to inference. */ originalClothingImage?: string; t: ResultComparisonTranslations; initialViewMode?: 'result' | 'compare'; } /** Shared Shopify and Woo result media, retaining the native range interaction. */ export function ResultComparison({ resultImage, originalPhotoImage, originalClothingImage, t, initialViewMode = 'result', }: ResultComparisonProps) { const [viewMode, setViewMode] = useState<'result' | 'compare'>(initialViewMode); const [beforeAfterPosition, setBeforeAfterPosition] = useState(50); return ( <> {originalClothingImage && (