// Components import Stack from "@mui/material/Stack"; import PulseDot from "../Animated/PulseDot.jsx"; import Typography from "@mui/material/Typography"; import Dot from "../Dot/index.jsx"; // Utils import { formatDurationRounded } from "../../../Utils/timeUtils.js"; import PropTypes from "prop-types"; import { useTheme } from "@emotion/react"; import { useMonitorUtils } from "../../../Hooks/useMonitorUtils.js"; import { formatMonitorUrl } from "../../../Utils/utils.js"; /** * Status component displays the status information of a monitor. * It includes the monitor's name, URL, and check interval. * * @component * @param {Object} props - Component props * @param {Object} props.monitor - The monitor object containing details * @param {string} props.monitor.name - The name of the monitor * @param {string} props.monitor.url - The URL of the monitor * @param {number} props.monitor.interval - The interval at which the monitor checks * @returns {JSX.Element} The rendered component */ const Status = ({ monitor }) => { const theme = useTheme(); const { statusColor, determineState } = useMonitorUtils(); return ( {monitor?.name} {formatMonitorUrl(monitor?.url)} Checking every {formatDurationRounded(monitor?.interval)}. ); }; Status.propTypes = { monitor: PropTypes.object, }; export default Status;