diff --git a/apps/web/pages/availability/index.tsx b/apps/web/pages/availability/index.tsx index 172f2fa14f..f8b2b43cb2 100644 --- a/apps/web/pages/availability/index.tsx +++ b/apps/web/pages/availability/index.tsx @@ -1,14 +1,17 @@ import { useAutoAnimate } from "@formkit/auto-animate/react"; -import { useRouter } from "next/navigation"; +import { useRouter, useSearchParams, usePathname } from "next/navigation"; +import { useCallback } from "react"; +import { useOrgBranding } from "@calcom/ee/organizations/context/provider"; import { getLayout } from "@calcom/features/MainLayout"; import { NewScheduleButton, ScheduleListItem } from "@calcom/features/schedules"; import { ShellMain } from "@calcom/features/shell/Shell"; +import { AvailabilitySliderTable } from "@calcom/features/timezone-buddy/components/AvailabilitySliderTable"; import { useLocale } from "@calcom/lib/hooks/useLocale"; import { HttpError } from "@calcom/lib/http-error"; import type { RouterOutputs } from "@calcom/trpc/react"; import { trpc } from "@calcom/trpc/react"; -import { EmptyScreen, showToast } from "@calcom/ui"; +import { EmptyScreen, showToast, ToggleGroup } from "@calcom/ui"; import { Clock } from "@calcom/ui/components/icon"; import { withQuery } from "@lib/QueryCell"; @@ -129,14 +132,54 @@ const WithQuery = withQuery(trpc.viewer.availability.list as any); export default function AvailabilityPage() { const { t } = useLocale(); + const searchParams = useSearchParams(); + const router = useRouter(); + const pathname = usePathname(); + const orgBranding = useOrgBranding(); + + // Get a new searchParams string by merging the current + // searchParams with a provided key/value pair + const createQueryString = useCallback( + (name: string, value: string) => { + const params = new URLSearchParams(searchParams ?? undefined); + params.set(name, value); + + return params.toString(); + }, + [searchParams] + ); return (
{JSON.stringify(dateRanges, null, 2)}; + return