From c9eac73fecb4efcb8179ea27eeb1b9220c1f0285 Mon Sep 17 00:00:00 2001 From: Devanshu Sharma Date: Thu, 29 May 2025 20:02:56 +0530 Subject: [PATCH] feat: add support for custom no schedule children in AvailabilitySettingsPlatformWrapper (#21601) Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> --- .../wrappers/AvailabilitySettingsPlatformWrapper.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx b/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx index 6ae43160e3..121944280b 100644 --- a/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx +++ b/packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx @@ -1,3 +1,5 @@ +import type { ReactNode } from "react"; + import type { ScheduleLabelsType } from "@calcom/features/schedules/components/Schedule"; import type { ApiErrorResponse, @@ -37,6 +39,7 @@ type AvailabilitySettingsPlatformWrapperProps = { allowSetToDefault?: boolean; disableToasts?: boolean; isDryRun?: boolean; + noScheduleChildren?: ReactNode; }; export const AvailabilitySettingsPlatformWrapper = ({ @@ -53,6 +56,7 @@ export const AvailabilitySettingsPlatformWrapper = ({ allowSetToDefault, disableToasts, isDryRun = false, + noScheduleChildren, }: AvailabilitySettingsPlatformWrapperProps) => { const { isLoading, data: schedule } = useSchedule(id); const { data: schedules } = useSchedules(); @@ -119,7 +123,13 @@ export const AvailabilitySettingsPlatformWrapper = ({ if (isLoading) return
Loading...
; - if (!atomSchedule) return
No user schedule present
; + if (!atomSchedule) { + return noScheduleChildren ? ( + <>{noScheduleChildren} + ) : ( +
No user schedule present
+ ); + } return (