import './AlertList.styles.scss'; import { Tabs } from 'antd'; import { TabsProps } from 'antd/lib'; import ConfigureIcon from 'assets/AlertHistory/ConfigureIcon'; import ROUTES from 'constants/routes'; import AllAlertRules from 'container/ListAlertRules'; import { PlannedDowntime } from 'container/PlannedDowntime/PlannedDowntime'; import TriggeredAlerts from 'container/TriggeredAlerts'; import { useSafeNavigate } from 'hooks/useSafeNavigate'; import useUrlQuery from 'hooks/useUrlQuery'; import { GalleryVerticalEnd, Pyramid } from 'lucide-react'; import AlertDetails from 'pages/AlertDetails'; import { useLocation } from 'react-router-dom'; function AllAlertList(): JSX.Element { const urlQuery = useUrlQuery(); const location = useLocation(); const { safeNavigate } = useSafeNavigate(); const tab = urlQuery.get('tab'); const isAlertHistory = location.pathname === ROUTES.ALERT_HISTORY; const isAlertOverview = location.pathname === ROUTES.ALERT_OVERVIEW; const search = urlQuery.get('search'); const items: TabsProps['items'] = [ { label: (
Triggered Alerts
), key: 'TriggeredAlerts', children: , }, { label: (
Alert Rules
), key: 'AlertRules', children: isAlertHistory || isAlertOverview ? : , }, { label: (
Configuration
), key: 'Configuration', children: , }, ]; return ( { urlQuery.set('tab', tab); let params = `tab=${tab}`; if (search) { params += `&search=${search}`; } safeNavigate(`/alerts?${params}`); }} className={`alerts-container ${ isAlertHistory || isAlertOverview ? 'alert-details-tabs' : '' }`} /> ); } export default AllAlertList;