import React from "react"; import { AlertGroup, Alert, AlertActionCloseButton, AlertVariant, } from "@patternfly/react-core"; export type AlertType = { key: number; message: string; variant: AlertVariant; description?: string; }; type AlertPanelProps = { alerts: AlertType[]; onCloseAlert: (key: number) => void; }; export function AlertPanel({ alerts, onCloseAlert }: AlertPanelProps) { return ( {alerts.map(({ key, variant, message, description }) => ( <> onCloseAlert(key)} /> } > {description &&

{description}

}
))}
); }