import Logo from "@/assets/icons/checkmate-icon.svg?react"; import Stack from "@mui/material/Stack"; import Box from "@mui/material/Box"; import Link from "@mui/material/Link"; import { LAYOUT } from "@/Utils/Theme/constants"; import { ErrorFallback, EmptyFallback, EmptyMonitorFallback, } from "@/Components/design-elements/Fallback"; import { EmptyState } from "@/Components/design-elements/EmptyState"; import { Breadcrumb } from "@/Components/design-elements/Breadcrumb"; import { PageHeader } from "@/Components/design-elements/PageHeader"; import CircularProgress from "@mui/material/CircularProgress"; import { LanguageSelector, SwitchTheme } from "@/Components/inputs"; import type { StackProps } from "@mui/material/Stack"; import { useTheme, alpha } from "@mui/material/styles"; import { Trans, useTranslation } from "react-i18next"; import { Link as RouterLink } from "react-router-dom"; import { Typography } from "@mui/material"; export const PageSpeedKeyPriorityFallback = () => { const theme = useTheme(); const { t } = useTranslation(); const alertBg = alpha(theme.palette.warning.main, 0.08); const alertBorder = alpha(theme.palette.warning.main, 0.45); const alertIcon = theme.palette.warning.main; return ( ⚠ ), }} /> } /> ); }; interface BasePageProps extends StackProps { loading?: boolean; error?: boolean; children: React.ReactNode; breadcrumbOverride?: string[]; headerKey?: string; backTo?: string; backLabel?: string; } export const BasePage = ({ loading, error, children, breadcrumbOverride, headerKey, backTo, backLabel, ...props }: BasePageProps) => { const theme = useTheme(); const { t } = useTranslation(); if (loading) { return ( ); } if (error) { return ( ); } return ( {headerKey ? ( ) : ( )} {children} ); }; interface BasePageWithStatesProps extends StackProps { loading: boolean; error: any; totalCount: number; description?: string; page: string; actionButtonText: string; actionLink: string; children: React.ReactNode; headerKey?: string; } export const BasePageWithStates = ({ loading, error, totalCount, page, description, actionButtonText, actionLink, children, headerKey, ...props }: BasePageWithStatesProps) => { const showLoading = loading && totalCount === 0; if (!loading && totalCount === 0) { return ( ); } return ( {children} ); }; interface MonitorBasePageWithStatesProps extends StackProps { loading: boolean; error: any; totalCount: number; page: string; actionLink?: string; children: React.ReactNode; priorityFallback?: React.ReactNode; headerKey?: string; } export const MonitorBasePageWithStates = ({ loading, error, totalCount, page, actionLink, children, priorityFallback, headerKey, ...props }: MonitorBasePageWithStatesProps) => { const { t } = useTranslation(); const showLoading = loading && totalCount === 0; if (priorityFallback) { return <>{priorityFallback}; } if (!loading && totalCount === 0) { return ( ); } return ( {children} ); }; interface BaseAuthPageProps extends React.PropsWithChildren, StackProps { title: string; subtitle: string; } export const BaseAuthPage = ({ title, subtitle, children, component, onSubmit, }: BaseAuthPageProps) => { const theme = useTheme(); const { t } = useTranslation(); return ( {t("common.appName")} {title} {subtitle} {children}
{t("pages.auth.brandPanel.eyebrow")} {t("pages.auth.brandPanel.tagline")} {t("pages.auth.brandPanel.description")} v{__APP_VERSION__} ); };