Skip to content

Commit 1f52ed7

Browse files
feat: Add loadingStateChildren prop to AvailabilitySettingsPlatformWrapper (calcom#21602)
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
1 parent a2c13e5 commit 1f52ed7

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

packages/platform/atoms/availability/wrappers/AvailabilitySettingsPlatformWrapper.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ type AvailabilitySettingsPlatformWrapperProps = {
4141
disableToasts?: boolean;
4242
isDryRun?: boolean;
4343
noScheduleChildren?: ReactNode;
44+
loadingStateChildren?: ReactNode;
4445
};
4546

4647
export const AvailabilitySettingsPlatformWrapper = ({
@@ -59,6 +60,7 @@ export const AvailabilitySettingsPlatformWrapper = ({
5960
disableToasts,
6061
isDryRun = false,
6162
noScheduleChildren,
63+
loadingStateChildren,
6264
}: AvailabilitySettingsPlatformWrapperProps) => {
6365
const { isLoading, data: schedule } = useSchedule(id);
6466
const { data: schedules } = useSchedules();
@@ -123,7 +125,13 @@ export const AvailabilitySettingsPlatformWrapper = ({
123125
}
124126
};
125127

126-
if (isLoading) return <div className="px-10 py-4 text-xl">Loading...</div>;
128+
if (isLoading) {
129+
return (
130+
<>
131+
{loadingStateChildren ? loadingStateChildren : <div className="px-10 py-4 text-xl">Loading...</div>}
132+
</>
133+
);
134+
}
127135

128136
if (!atomSchedule) {
129137
return noScheduleChildren ? (

0 commit comments

Comments
 (0)