2026-01-23 19:58:37 +00:00
|
|
|
import Stack from "@mui/material/Stack";
|
|
|
|
|
import { useTheme } from "@mui/material/styles";
|
2026-04-25 21:19:52 -04:00
|
|
|
import { LAYOUT } from "@/Utils/Theme/constants";
|
|
|
|
|
import { EmptyState } from "./EmptyState";
|
|
|
|
|
|
2026-01-23 19:58:37 +00:00
|
|
|
import type { StackProps } from "@mui/material/Stack";
|
|
|
|
|
|
|
|
|
|
interface BaseFallbackProps extends StackProps {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const BaseFallback = ({ children, ...props }: BaseFallbackProps) => {
|
|
|
|
|
const theme = useTheme();
|
|
|
|
|
return (
|
|
|
|
|
<Stack
|
2026-04-25 21:19:52 -04:00
|
|
|
alignItems="center"
|
|
|
|
|
justifyContent="center"
|
|
|
|
|
sx={{ width: "100%", py: theme.spacing(LAYOUT.LG) }}
|
2026-01-23 19:58:37 +00:00
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</Stack>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const ErrorFallback = ({
|
|
|
|
|
title,
|
|
|
|
|
subtitle,
|
|
|
|
|
}: {
|
|
|
|
|
title: string;
|
|
|
|
|
subtitle: string;
|
|
|
|
|
}) => {
|
|
|
|
|
return (
|
2026-04-25 21:19:52 -04:00
|
|
|
<EmptyState
|
2026-04-25 23:26:34 -04:00
|
|
|
fullscreen
|
2026-04-25 21:19:52 -04:00
|
|
|
title={title}
|
|
|
|
|
description={subtitle}
|
|
|
|
|
/>
|
2026-01-23 19:58:37 +00:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const EmptyFallback = ({
|
|
|
|
|
title,
|
2026-04-25 23:26:34 -04:00
|
|
|
description,
|
2026-01-23 19:58:37 +00:00
|
|
|
actionButtonText,
|
|
|
|
|
actionLink,
|
|
|
|
|
}: {
|
|
|
|
|
title: string;
|
2026-04-25 23:26:34 -04:00
|
|
|
description?: string;
|
2026-01-23 19:58:37 +00:00
|
|
|
actionButtonText: string;
|
|
|
|
|
actionLink: string;
|
|
|
|
|
}) => {
|
|
|
|
|
return (
|
2026-04-25 21:19:52 -04:00
|
|
|
<EmptyState
|
2026-04-25 23:26:34 -04:00
|
|
|
fullscreen
|
2026-04-25 21:19:52 -04:00
|
|
|
title={title}
|
2026-04-25 23:26:34 -04:00
|
|
|
description={description}
|
2026-04-25 21:19:52 -04:00
|
|
|
actionText={actionButtonText}
|
|
|
|
|
actionTo={actionLink}
|
|
|
|
|
/>
|
2026-01-23 19:58:37 +00:00
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const EmptyMonitorFallback = ({
|
|
|
|
|
title,
|
2026-04-25 23:26:34 -04:00
|
|
|
description,
|
2026-01-23 19:58:37 +00:00
|
|
|
actionButtonText,
|
|
|
|
|
actionLink,
|
|
|
|
|
}: {
|
|
|
|
|
page: string;
|
|
|
|
|
title: string;
|
2026-04-25 23:26:34 -04:00
|
|
|
description?: string;
|
2026-01-23 19:58:37 +00:00
|
|
|
actionButtonText: string;
|
|
|
|
|
actionLink: string;
|
|
|
|
|
}) => {
|
|
|
|
|
return (
|
2026-04-25 21:19:52 -04:00
|
|
|
<EmptyState
|
2026-04-25 23:26:34 -04:00
|
|
|
fullscreen
|
2026-04-25 21:19:52 -04:00
|
|
|
title={title}
|
2026-04-25 23:26:34 -04:00
|
|
|
description={description}
|
2026-04-25 21:19:52 -04:00
|
|
|
actionText={actionButtonText}
|
|
|
|
|
actionTo={actionLink}
|
|
|
|
|
/>
|
2026-01-23 19:58:37 +00:00
|
|
|
);
|
|
|
|
|
};
|