- title -
-- message -
-- EuiNotificationEvent is being deprecated due to low - usage and high maintenance requirements. -
-
- If necessary, we recommend{' '}
-
- message -
-- message -
-- message -
-- message -
-- message -
-- message -
-- message 1 -
-- message 2 -
-- message 3 -
-- message -
-- message -
-- message -
-` tags - */ - messages: string[]; - /** - * A unique, human-friendly name for the event to be used in aria attributes (e.g. "alert-critical-01", "cloud-no-severity-12", etc..). - */ - eventName: string; -}; - -export const EuiNotificationEventMessages: FunctionComponent< - EuiNotificationEventMessagesProps -> = ({ messages, eventName }) => { - const [isOpen, setIsOpen] = useState(false); - const messagesLength = messages.length; - - const accordionId = useGeneratedHtmlId({ - prefix: 'euiNotificationEventMessagesAccordion', - }); - - const accordionButtonText = useEuiI18n( - 'euiNotificationEventMessages.accordionButtonText', - '+ {messagesLength} more', - { messagesLength: messagesLength - 1 } - ); - - const accordionAriaLabelButtonText = useEuiI18n( - 'euiNotificationEventMessages.accordionAriaLabelButtonText', - '+ {messagesLength} messages for {eventName}', - { - messagesLength: messagesLength - 1, - eventName, - } - ); - - const accordionHideText = useEuiI18n( - 'euiNotificationEventMessages.accordionHideText', - 'hide' - ); - - const buttonContentText = isOpen - ? `${accordionButtonText} (${accordionHideText})` - : accordionButtonText; - - return ( -
{messages}
-{messages[0]}
-{notification}
-