import PropTypes from "prop-types"; import { Box, Stack, Typography } from "@mui/material"; import { useTheme } from "@emotion/react"; import { useTranslation } from "react-i18next"; import PanelSkeleton from "../IncidentsSummaryPanel/skeleton.jsx"; import Icon from "@/Components/v1/Icon"; import SummaryCard from "../SummaryCard/index.jsx"; /** * ActiveIncidentsPanel Component * * Displays a quick overview of currently active incidents. * Shows only essential information: monitor name, status badge, and duration. * * @param {Object} props * @param {Array} props.incidents - Array of active incidents * @param {number} props.totalCount - Total count of active incidents (for badge) * @param {boolean} props.isLoading - Loading state * @param {Object} props.error - Error object if any * @param {Function} props.onIncidentClick - Callback when incident is clicked (optional) */ const ActiveIncidentsPanel = ({ totalCount = 0, isLoading = false, error = null }) => { const theme = useTheme(); const { t } = useTranslation(); if (isLoading) { return ; } if (error) { return ( {t("incidentsPage.incidentsActivePanelError")} ); } if (!totalCount || totalCount === 0) { return ( {t("incidentsPage.allSystemsAreOperational")} ); } return ( {totalCount} ); }; ActiveIncidentsPanel.propTypes = { totalCount: PropTypes.number, isLoading: PropTypes.bool, error: PropTypes.object, onIncidentClick: PropTypes.func, }; export default ActiveIncidentsPanel;