import * as React from 'react';
import { useAdaptable } from '../AdaptableContext';
import * as ModuleConstants from '../../Utilities/Constants/ModuleConstants';
import { AdaptableObjectCompactList } from '../Components/AdaptableObjectList/AdaptableObjectCompactList';
import { useSelector } from 'react-redux';
export const ActiveAlertsPanel = () => {
    const adaptable = useAdaptable();
    const filterModule = adaptable.ModuleService.getModuleById(ModuleConstants.AlertModuleId);
    const alerts = useSelector((state) => state.Internal.AdaptableAlerts);
    // map the suspended property from the underlying AlertDefinitions
    alerts.forEach((alert) => {
        const liveAlertDef = adaptable.api.alertApi.getAlertDefinitionById(alert.alertDefinition.Uuid);
        if (liveAlertDef) {
            // @ts-ignore theoretically AdaptableAlert is not Suspendable; practically <AdaptableObjectCompactList> expects it
            alert.IsSuspended = liveAlertDef.IsSuspended;
        }
    });
    return React.createElement(AdaptableObjectCompactList, { abObjects: alerts, module: filterModule });
};
