UNPKG

@shopgate/engage

Version:
7 lines 785 B
import React from'react';import PropTypes from'prop-types';import{I18n}from"../../../components";import styles from"./styles";/** * The LiveMessage component can be used to broadcast "aria-live" messages to assistive technology. * @param {string} message The message - i18n placeholders are supported. * @param {Object} params Optional params for the message. * @param {string} 'aria-live' The aria-live type. * @returns {JSX} */var LiveMessage=function LiveMessage(_ref){var message=_ref.message,params=_ref.params,ariaLive=_ref['aria-live'];return React.createElement("div",{className:styles,role:"log","aria-live":ariaLive},React.createElement(I18n.Text,{string:message,params:params}));};LiveMessage.defaultProps={'aria-live':'polite',params:null};export default LiveMessage;