import { useState } from "react"; import { copy, type Language } from "../copy"; const moments = ["normal", "lowConfidence", "blocked"] as const; export function DemoPreview({ language }: { language: Language }) { const [step, setStep] = useState(null); const text = copy[language].demo; const workspace = copy[language].workspace; const moment = step === null ? null : moments[step]; const source = moment === "normal" ? text.normalSource : moment === "lowConfidence" ? text.lowSource : text.blockedSource; const translation = moment === "normal" ? text.normalTranslation : moment === "lowConfidence" ? text.lowTranslation : text.blockedTranslation; return (

{text.eyebrow}

{text.heading}

{workspace.mockDisclaimer}

{moment ? (

{text.step.replace("{current}", String((step ?? 0) + 1))}

{text[moment]}

{source}

{translation}

{moment === "lowConfidence" ?

{workspace.lowConfidence}

: null} {moment === "blocked" ?

{workspace.confirmationRequired}

: null}
) : null}
); }