import type { ReactNode } from "react";
import React from "react";
import { useEventTypeById, useIsPlatform } from "@calcom/atoms/monorepo";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Badge, Dialog, DialogContent } from "@calcom/ui";
import { getDurationFormatted } from "../../../components/event-meta/Duration";
import { useBookerStore } from "../../store";
import { FromTime } from "../../utils/dates";
import { useEvent } from "../../utils/event";
import { useBookerTime } from "../hooks/useBookerTime";
const BookEventFormWrapper = ({ children, onCancel }: { onCancel: () => void; children: ReactNode }) => {
const { data } = useEvent();
return ;
};
const PlatformBookEventFormWrapper = ({
children,
onCancel,
}: {
onCancel: () => void;
children: ReactNode;
}) => {
const eventId = useBookerStore((state) => state.eventId);
const { data } = useEventTypeById(eventId);
return (
);
};
export const BookEventFormWrapperComponent = ({
child,
eventLength,
}: {
onCancel: () => void;
child: ReactNode;
eventLength?: number;
}) => {
const { i18n, t } = useLocale();
const selectedTimeslot = useBookerStore((state) => state.selectedTimeslot);
const selectedDuration = useBookerStore((state) => state.selectedDuration);
const { timeFormat, timezone } = useBookerTime();
if (!selectedTimeslot) {
return null;
}
return (
<>
{t("confirm_your_details")}
{(selectedDuration || eventLength) && (
{getDurationFormatted(selectedDuration || eventLength, t)}
)}
{child}
>
);
};
export const BookFormAsModal = ({
visible,
onCancel,
children,
}: {
visible: boolean;
onCancel: () => void;
children: ReactNode;
}) => {
const isPlatform = useIsPlatform();
return (
);
};