feat: Add loadingStateChildren prop to AvailabilitySettingsPlatformWrapper (#21602)
Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com>
This commit is contained in:
1 parent
a2c13e576e
commit
1f52ed7290
1 file changed
+9
-1
+9
-1
@@ -41,6 +41,7 @@ type AvailabilitySettingsPlatformWrapperProps = {
|
||||
disableToasts?: boolean;
|
||||
isDryRun?: boolean;
|
||||
noScheduleChildren?: ReactNode;
|
||||
loadingStateChildren?: ReactNode;
|
||||
};
|
||||
|
||||
export const AvailabilitySettingsPlatformWrapper = ({
|
||||
@@ -59,6 +60,7 @@ export const AvailabilitySettingsPlatformWrapper = ({
|
||||
disableToasts,
|
||||
isDryRun = false,
|
||||
noScheduleChildren,
|
||||
loadingStateChildren,
|
||||
}: AvailabilitySettingsPlatformWrapperProps) => {
|
||||
const { isLoading, data: schedule } = useSchedule(id);
|
||||
const { data: schedules } = useSchedules();
|
||||
@@ -123,7 +125,13 @@ export const AvailabilitySettingsPlatformWrapper = ({
|
||||
}
|
||||
};
|
||||
|
||||
if (isLoading) return <div className="px-10 py-4 text-xl">Loading...</div>;
|
||||
if (isLoading) {
|
||||
return (
|
||||
<>
|
||||
{loadingStateChildren ? loadingStateChildren : <div className="px-10 py-4 text-xl">Loading...</div>}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
if (!atomSchedule) {
|
||||
return noScheduleChildren ? (
|
||||
|
||||
Reference in new issue
Block a user