import type { SystemHealthStatus } from "../../../../types/types"; import Card from "../../../../ui/Card"; import StatusIndicators from "../../../../ui/StatusIndicators"; import { capitalize } from "../../../../utils/utils"; import CameraStatusGridItem from "./CameraStatusGridItem"; type CameraStatusProps = { title: string; category: SystemHealthStatus[]; isError?: boolean; }; const CameraStatus = ({ title, category, isError }: CameraStatusProps) => { const isAllGood = category && category.length > 0 && category.every((status) => status.tags.includes("RUNNING")); // check if some are down // check if all are down //check if offline return (

{isError ? ( ) : isAllGood ? ( ) : ( )} {capitalize(title)}

{isError ? (

Error loading camera health.

) : isAllGood ? (

All systems running

) : (

Some systems down

)}
{category && category?.length <= 0 ? (

Loading Camera health...

) : (
)}
); }; export default CameraStatus;