1 import { useState, useEffect } from ‘react’;
2 import { Link } from ‘react-router-dom’;
3 import { motion } from ‘framer-motion’;
4 import { CheckCircle, Volume2, Clock, ArrowLeft, Headphones } from ‘lucide-react’;
5 import { Button } from ‘@/components/ui/button’;
6 import { base44 } from ‘@/api/base44Client’;
7 import { ACCOMMODATIONS, SEASON_INFO, GROUP_PROFILES, INTERESTS } from ‘@/lib/audioLogic’;
export default function Confirmation() {
const [guest, setGuest] = useState(null);
const [loading, setLoading] = useState(true);
useEffect(() => {
const params = new URLSearchParams(window.location.search);
const id = params.get(‘id’);
if (id) {
base44.entities.Guest.get(id).then((data) => {
setGuest(data);
setLoading(false);
});
} else {
setLoading(false);
}
}, []);
if (loading) {
return (
);
}
if (!guest) {
return (
No se encontró la reserva.
);
}
const accommodation = ACCOMMODATIONS.find(a => a.id === guest.accommodation);
const seasonData = guest.season ? SEASON_INFO[guest.season] : null;
return (
¡Gracias, {guest.name}!
Tu audio personalizado está en camino
{/* Summary card */}
{/* Accommodation */}
{accommodation && (
{accommodation.name}
{accommodation.description}
)}
{/* Dates */}
{guest.nights} noche{guest.nights !== 1 ? ‘s’ : »}
{new Date(guest.check_in).toLocaleDateString(‘es-ES’, { day: ‘numeric’, month: ‘long’ })} — {new Date(guest.check_out).toLocaleDateString(‘es-ES’, { day: ‘numeric’, month: ‘long’, year: ‘numeric’ })}
{seasonData && (
{seasonData.icon}
)}
{/* Group */}
{guest.group_profile?.length > 0 && (
const profile = GROUP_PROFILES.find(p => p.id === gp);
return profile ? (
{profile.icon} {profile.label}
) : null;
})}
)}
{/* Interests */}
{guest.interests?.length > 0 && (
const interest = INTERESTS.find(int => int.id === i);
return interest ? (
{interest.icon} {interest.label}
) : null;
})}
)}
{/* Audio modules count */}
{guest.audio_modules?.length > 0 && (
{guest.audio_modules.length} módulos de audio seleccionados
)}
{/* Status */}
Estado: Procesando
Te enviaremos el audio personalizado a{‘ ‘}
{guest.email && {guest.email}}
{guest.email && guest.phone && ‘ o ‘}
{guest.phone && {guest.phone}}
);
}
