feat(client): unified EmptyState component for empty/error placeholders
Replaces the cards-with-halo SkeletonCard fallback (which produced a washed-out, hard-to-read placeholder) with a single canonical empty state used everywhere in the app. What's new: - EmptyStateIllustration.tsx — custom inline SVG: two stacked monitor cards (front blue, back gray, both with hairline strokes and a soft fade toward the bottom), set against a faint grid of solid + dashed background lines. Uses only lightened palette tokens (#7DA8E8 blue, #B6C2CF gray, #CBD5E1 grid). - EmptyState.tsx — the layout: illustration + title + description + optional CTA + optional secondary link + optional inline alert slot. Supports a compact horizontal variant for in-panel use. Migrations: - Fallback.tsx: BaseFallback / EmptyFallback / EmptyMonitorFallback / ErrorFallback now delegate to EmptyState. Public APIs unchanged so every existing consumer (BasePageWithStates, MonitorBasePageWithStates, Pages/Uptime, Pages/Notifications, Pages/Infrastructure, etc.) keeps working without edits. - BasePage.tsx: PageSpeedKeyPriorityFallback rebuilt on top of EmptyState with the warning slot. Fixes the previous reports of "white cloudy area" + half-faded text — message and link now render in consistent dark text with green Settings link. No prop changes for any page-level consumer. The illustration is a single SVG with no external assets.
This commit is contained in:
1 parent
29f1041cc3
commit
ff208710d7
5 files changed
+451
-144
No files matched your search
@@ -1,15 +1,14 @@
|
||||
import Logo from "@/assets/icons/checkmate-icon.svg?react";
|
||||
import Stack from "@mui/material/Stack";
|
||||
import Box from "@mui/material/Box";
|
||||
import Alert from "@mui/material/Alert";
|
||||
import Link from "@mui/material/Link";
|
||||
import { LAYOUT, SPACING } from "@/Utils/Theme/constants";
|
||||
import {
|
||||
ErrorFallback,
|
||||
EmptyFallback,
|
||||
EmptyMonitorFallback,
|
||||
BaseFallback,
|
||||
} from "@/Components/design-elements/Fallback";
|
||||
import { EmptyState } from "@/Components/design-elements/EmptyState";
|
||||
import { Breadcrumb } from "@/Components/design-elements/Breadcrumb";
|
||||
import CircularProgress from "@mui/material/CircularProgress";
|
||||
import { HeaderAuthControls } from "@/Pages/Auth/components/HeaderAuthControls";
|
||||
@@ -21,32 +20,58 @@ import { Link as RouterLink } from "react-router-dom";
|
||||
import { Typography } from "@mui/material";
|
||||
|
||||
export const PageSpeedKeyPriorityFallback = () => {
|
||||
const theme = useTheme();
|
||||
return (
|
||||
<BaseFallback>
|
||||
<Alert
|
||||
severity="warning"
|
||||
sx={{
|
||||
width: "100%",
|
||||
maxWidth: 600,
|
||||
}}
|
||||
>
|
||||
<Typography>
|
||||
<Trans
|
||||
i18nKey="common.alerts.pageSpeedApiKey.content"
|
||||
components={{
|
||||
settingsLink: (
|
||||
<Link
|
||||
component={RouterLink}
|
||||
to="/settings"
|
||||
color="inherit"
|
||||
fontWeight="inherit"
|
||||
/>
|
||||
),
|
||||
<EmptyState
|
||||
title="PageSpeed monitor needs an API key"
|
||||
alert={
|
||||
<Stack
|
||||
direction="row"
|
||||
alignItems="flex-start"
|
||||
gap={theme.spacing(LAYOUT.SM)}
|
||||
sx={{
|
||||
width: "100%",
|
||||
p: theme.spacing(LAYOUT.MD),
|
||||
borderRadius: 1,
|
||||
border: `1px solid ${theme.palette.warning.main}`,
|
||||
backgroundColor: theme.palette.warning.light,
|
||||
textAlign: "left",
|
||||
}}
|
||||
>
|
||||
<Box
|
||||
component="span"
|
||||
sx={{
|
||||
color: theme.palette.warning.dark,
|
||||
fontSize: 18,
|
||||
lineHeight: 1,
|
||||
mt: "2px",
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</Alert>
|
||||
</BaseFallback>
|
||||
>
|
||||
⚠
|
||||
</Box>
|
||||
<Typography
|
||||
sx={{ color: theme.palette.text.primary, lineHeight: 1.55, fontSize: 13 }}
|
||||
>
|
||||
<Trans
|
||||
i18nKey="common.alerts.pageSpeedApiKey.content"
|
||||
components={{
|
||||
settingsLink: (
|
||||
<Link
|
||||
component={RouterLink}
|
||||
to="/settings"
|
||||
sx={{
|
||||
color: theme.palette.primary.main,
|
||||
fontWeight: 600,
|
||||
textDecoration: "underline",
|
||||
}}
|
||||
/>
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Typography>
|
||||
</Stack>
|
||||
}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user