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

44 lines
1.2 KiB
React
Raw Normal View History

2025-01-28 15:42:46 -08:00
import StatusBoxes from "../../../../../Components/StatusBoxes";
import StatBox from "../../../../../Components/StatBox";
import { Typography } from "@mui/material";
import { getHumanReadableDuration } from "../../../../../Utils/timeUtils";
2025-03-17 01:16:42 +05:30
import { useTranslation } from "react-i18next";
2025-01-28 15:42:46 -08:00
const PageSpeedStatusBoxes = ({ shouldRender, monitor }) => {
const { time: uptimeDuration, units: uptimeUnits } = getHumanReadableDuration(
monitor?.uptimeDuration
);
const { time: lastCheckTime, units: lastCheckUnits } = getHumanReadableDuration(
monitor?.lastChecked
);
2025-03-17 01:16:42 +05:30
const { t } = useTranslation();
2025-01-28 15:42:46 -08:00
return (
<StatusBoxes shouldRender={shouldRender}>
<StatBox
heading="checks since"
subHeading={
<>
{uptimeDuration}
<Typography component="span">{uptimeUnits}</Typography>
2025-03-17 01:16:42 +05:30
<Typography component="span">{t("ago")}</Typography>
2025-01-28 15:42:46 -08:00
</>
}
/>
<StatBox
heading="last check"
subHeading={
<>
{lastCheckTime}
<Typography component="span">{lastCheckUnits}</Typography>
2025-03-17 01:16:42 +05:30
<Typography component="span">{t("ago")}</Typography>
2025-01-28 15:42:46 -08:00
</>
}
/>
</StatusBoxes>
);
};
export default PageSpeedStatusBoxes;