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

37 lines
965 B
React
Raw Normal View History

2025-09-27 14:54:55 -07:00
import StatusBoxes from "@/Components/v1/StatusBoxes/index.jsx";
import StatBox from "@/Components/v1/StatBox/index.jsx";
2025-01-28 15:42:46 -08:00
import { Typography } from "@mui/material";
2026-01-12 23:57:39 +00:00
import { getHumanReadableDuration } from "../../../../../Utils/timeUtils.js";
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 }) => {
2025-06-17 13:41:25 +08:00
const uptimeDuration = getHumanReadableDuration(monitor?.uptimeDuration);
const time = getHumanReadableDuration(monitor?.lastChecked);
2025-01-28 15:42:46 -08:00
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}
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={
<>
2025-06-17 13:41:25 +08:00
{time}
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;