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 (
{config.address_name}
{/* Live Countdown */}{config.msg_duplicate || "Parece que ya tenemos tus datos registrados. ¡Te esperamos!"}
{/* Live Countdown */}{config.msg_error || "No pudimos registrar tu asistencia. Inténtalo nuevamente."}
{config.msg_success || "Tu asistencia ha sido confirmada."}
{confirmedName && ({greeting}
)} {/* Decorative divider dot */} {/* Live Countdown */}