import { useT } from "@agent-native/core/client/i18n"; import type { Booking, CustomField } from "@shared/api"; import { IconCircleCheck, IconVideo } from "@tabler/icons-react"; import { format, parseISO } from "date-fns"; import { Link } from "react-router"; import { Button } from "@/components/ui/button"; interface BookingConfirmationProps { booking: Booking; customFields?: CustomField[]; onReset: () => void; } const BRAND_LINK_CLASS = "font-semibold text-[#00B5FF] hover:text-[#33C4FF]"; export function BookingConfirmation({ booking, customFields = [], onReset, }: BookingConfirmationProps) { const t = useT(); const responses = booking.fieldResponses; const fieldsWithResponses = customFields.filter( (f) => responses?.[f.id] !== undefined && responses[f.id] !== "" && responses[f.id] !== false, ); return (
{t("bookingLinks.confirmationSent")}
{booking.eventTitle}
{format(parseISO(booking.start), "EEEE, MMMM d, yyyy")}
{format(parseISO(booking.start), "h:mm a")} -{" "} {format(parseISO(booking.end), "h:mm a")}
{booking.name}
{typeof responses![field.id] === "boolean" ? responses![field.id] ? t("bookingLinks.yes") : t("bookingLinks.no") : String(responses![field.id])}
{t("bookingLinks.needToMakeChanges")}{" "} {t("bookingLinks.cancelOrReschedule")}
)}