Files
Checkmate/src/Pages/PageSpeed/Details/Components/PerformanceReport/index.jsx
T

53 lines
1.4 KiB
React
Raw Normal View History

2025-01-28 15:42:46 -08:00
import ChartBox from "../../../../../Components/Charts/ChartBox";
import PerformanceIcon from "../../../../../assets/icons/performance-report.svg?react";
import PieChart from "../Charts/PieChart";
import { Typography } from "@mui/material";
import { useTheme } from "@emotion/react";
import PieChartLegend from "../Charts/PieChartLegend";
2025-01-28 15:51:58 -08:00
import SkeletonLayout from "./skeleton";
2025-03-17 01:16:42 +05:30
import { useTranslation } from "react-i18next";
2025-01-29 11:42:40 -08:00
2025-01-28 15:51:58 -08:00
const PerformanceReport = ({ shouldRender, audits }) => {
2025-01-28 15:42:46 -08:00
const theme = useTheme();
2025-03-17 01:16:42 +05:30
const { t } = useTranslation();
2025-01-28 15:51:58 -08:00
if (!shouldRender) {
return <SkeletonLayout />;
}
2025-01-28 15:42:46 -08:00
return (
<ChartBox
icon={<PerformanceIcon />}
header="Performance report"
Legend={<PieChartLegend audits={audits} />}
borderRadiusRight={16}
>
<PieChart audits={audits} />
<Typography
variant="body1"
mt="auto"
>
2025-03-17 01:16:42 +05:30
{t("pageSpeedDetailsPerformanceReport")}{" "}
2025-01-28 15:42:46 -08:00
<Typography
component="span"
fontSize="inherit"
sx={{
2025-03-26 18:35:03 -04:00
color: theme.palette.primary.contrastTextTertiary,
2025-01-28 15:42:46 -08:00
fontWeight: 500,
textDecoration: "underline",
textUnderlineOffset: 2,
transition: "all 200ms",
cursor: "pointer",
"&:hover": {
textUnderlineOffset: 4,
},
}}
>
2025-03-17 01:16:42 +05:30
{t("pageSpeedDetailsPerformanceReportCalculator")}
2025-01-28 15:42:46 -08:00
</Typography>
</Typography>
</ChartBox>
);
};
export default PerformanceReport;