// Components import { Stack, Typography, Button, ButtonGroup } from "@mui/material"; import Select from "@/Components/v1/Inputs/Select/index.jsx"; import PropTypes from "prop-types"; //Utils import { useTheme } from "@emotion/react"; import SkeletonLayout from "./skeleton.jsx"; import { useTranslation } from "react-i18next"; const OptionsHeader = ({ shouldRender, selectedMonitor = 0, setSelectedMonitor, monitors, filter = "all", setFilter, dateRange = "hour", setDateRange, }) => { const theme = useTheme(); const { t } = useTranslation(); const monitorNames = typeof monitors !== "undefined" ? Object.values(monitors) : []; const filterOptions = [ { id: "all", name: t("incidentsOptionsHeaderFilterAll") }, { id: "down", name: t("incidentsOptionsHeaderFilterDown") }, { id: "resolve", name: t("incidentsOptionsHeaderFilterCannotResolve") }, { id: "resolved", name: t("incidentsOptionsHeaderFilterResolved") }, ]; // The stacks below which are three in number have the same style so const stackStyles = { direction: "row", alignItems: "center", gap: theme.spacing(6), }; if (!shouldRender) return ; return ( {t("incidentsOptionsHeader")} setFilter(e.target.value)} items={filterOptions} sx={{ backgroundColor: theme.palette.primary.main, color: theme.palette.primary.contrastTextSecondary, }} /> {t("incidentsOptionsHeaderShow")} ); }; OptionsHeader.propTypes = { shouldRender: PropTypes.bool, selectedMonitor: PropTypes.string, setSelectedMonitor: PropTypes.func, monitors: PropTypes.object, filter: PropTypes.string, setFilter: PropTypes.func, dateRange: PropTypes.string, setDateRange: PropTypes.func, }; export default OptionsHeader;