Add skeletons and loading conditions

This commit is contained in:
Alex Holliday committed 2025-01-28 15:51:58 -08:00
1 parent ac2cf49082
commit a33c0c16a0
5 files changed
+64 -11

No files matched your search

@@ -1,13 +1,20 @@
import ChartBox from "../../../../../Components/Charts/ChartBox";
import AreaChart from "../Charts/AreaChart";
import AreaChartLegend from "../Charts/AreaChartLegend";
import SkeletonLayout from "./skeleton";
import ScoreIcon from "../../../../../assets/icons/monitor-graph-line.svg?react";
import { Stack } from "@mui/material";
import PropTypes from "prop-types";
import { useTheme } from "@emotion/react";
const PageSpeedAreaChart = ({ shouldRender, monitor, metrics, handleMetrics }) => {
const theme = useTheme();
if (!shouldRender) {
return <SkeletonLayout />;
}
if (typeof monitor === "undefined") {
return null;
}
@@ -42,4 +49,11 @@ const PageSpeedAreaChart = ({ shouldRender, monitor, metrics, handleMetrics }) =
);
};
PageSpeedAreaChart.propTypes = {
shouldRender: PropTypes.bool,
monitor: PropTypes.object,
metrics: PropTypes.object,
handleMetrics: PropTypes.func,
};
export default PageSpeedAreaChart;