import { Button } from "../components/Button"; import { useCountdown } from "../hooks/useCountdown"; import type { RsvpFormState } from "../hooks/useRsvpForm"; import type { InvitationConfig } from "../types/config"; import { Countdown } from "./Countdown"; import { MapPreview } from "./MapPreview"; import { VenueInfo } from "./VenueInfo"; interface RsvpResultProps { formState: RsvpFormState; confirmedName: string; config: InvitationConfig; onRetry: () => void; isDetailsOnly?: boolean; onBackToForm?: () => void; } export function RsvpResult({ formState, confirmedName, config, onRetry, isDetailsOnly = false, onBackToForm, }: RsvpResultProps) { const countdown = useCountdown( config.event_date, config.event_time, config.event_timezone, ); if (isDetailsOnly) { return (

Ubicación del Evento

{config.address_name}

{/* Live Countdown */} {/* Decorative divider dot */} {/* Circular Map Preview and Venue Logistics */} {onBackToForm && (
)}
); } if (formState === "duplicate") { return (

¡Ya estás registrado!

{config.msg_duplicate || "Parece que ya tenemos tus datos registrados. ¡Te esperamos!"}

{/* Live Countdown */} {/* Circular Map Preview and Venue Logistics */}
); } if (formState === "error") { return (

Algo salió mal

{config.msg_error || "No pudimos registrar tu asistencia. Inténtalo nuevamente."}

); } // Success Confirmation State const greeting = (config.msg_success_greeting || "Gracias, {name}.").replace( "{name}", confirmedName || "", ); return (

¡Perfecto!

{config.msg_success || "Tu asistencia ha sido confirmada."}

{confirmedName && (

{greeting}

)} {/* Decorative divider dot */} {/* Live Countdown */} {/* Decorative divider dot */} {/* Circular Map Preview and Venue Logistics */}
); }