{getRecurringFreq({ t, recurringEvent: eventType.recurringEvent })}
{t("occurrence", { count: recurringEventCount, })}
{t("former_time")}
import dynamic from "next/dynamic"; import { useRouter } from "next/router"; import { useEffect, useMemo, useState } from "react"; import { z } from "zod"; import BookingPageTagManager from "@calcom/app-store/BookingPageTagManager"; import dayjs from "@calcom/dayjs"; import { useEmbedNonStylesConfig, useEmbedStyles, useEmbedUiConfig, useIsBackgroundTransparent, useIsEmbed, } from "@calcom/embed-core/embed-iframe"; import classNames from "@calcom/lib/classNames"; import useGetBrandingColours from "@calcom/lib/getBrandColours"; import getPaymentAppData from "@calcom/lib/getPaymentAppData"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import useTheme from "@calcom/lib/hooks/useTheme"; import notEmpty from "@calcom/lib/notEmpty"; import { getRecurringFreq } from "@calcom/lib/recurringStrings"; import { detectBrowserTimeFormat, setIs24hClockInLocalStorage, TimeFormat } from "@calcom/lib/timeFormat"; import { trpc } from "@calcom/trpc"; import { HeadSeo, NumberInput, useCalcomTheme } from "@calcom/ui"; import { CreditCard, User, RefreshCcw } from "@calcom/ui/components/icon"; import { timeZone as localStorageTimeZone } from "@lib/clock"; import BookingDescription from "@components/booking/BookingDescription"; import { SlotPicker } from "@components/booking/SlotPicker"; import type { AvailabilityPageProps } from "../../../pages/[user]/[type]"; import type { DynamicAvailabilityPageProps } from "../../../pages/d/[link]/[slug]"; import type { AvailabilityTeamPageProps } from "../../../pages/team/[slug]/[type]"; const PoweredBy = dynamic(() => import("@calcom/ee/components/PoweredBy")); const Toaster = dynamic(() => import("react-hot-toast").then((mod) => mod.Toaster), { ssr: false }); /*const SlotPicker = dynamic(() => import("../SlotPicker").then((mod) => mod.SlotPicker), { ssr: false, loading: () =>
, });*/ const TimezoneDropdown = dynamic(() => import("../TimezoneDropdown").then((mod) => mod.TimezoneDropdown), { ssr: false, }); const dateQuerySchema = z.object({ rescheduleUid: z.string().optional().default(""), date: z.string().optional().default(""), timeZone: z.string().optional().default(""), seatReferenceUid: z.string().optional(), }); export type Props = AvailabilityTeamPageProps | AvailabilityPageProps | DynamicAvailabilityPageProps; const useBrandColors = ({ brandColor, darkBrandColor }: { brandColor: string; darkBrandColor: string }) => { const brandTheme = useGetBrandingColours({ lightVal: brandColor, darkVal: darkBrandColor, }); useCalcomTheme(brandTheme); }; const AvailabilityPage = ({ profile, eventType, ...restProps }: Props) => { const router = useRouter(); const isEmbed = useIsEmbed(restProps.isEmbed); const query = dateQuerySchema.parse(router.query); const { rescheduleUid } = query; useTheme(profile.theme); useBrandColors({ brandColor: profile.brandColor, darkBrandColor: profile.darkBrandColor, }); const { t, i18n } = useLocale(); const availabilityDatePickerEmbedStyles = useEmbedStyles("availabilityDatePicker"); //TODO: Plan to remove shouldAlignCentrallyInEmbed config const shouldAlignCentrallyInEmbed = useEmbedNonStylesConfig("align") !== "left"; const shouldAlignCentrally = !isEmbed || shouldAlignCentrallyInEmbed; const isBackgroundTransparent = useIsBackgroundTransparent(); const [timeZone, setTimeZone] = useState{getRecurringFreq({ t, recurringEvent: eventType.recurringEvent })}
{t("occurrence", { count: recurringEventCount, })}
{t("former_time")}