import React from 'react'; import { I18n } from '@lingui/react'; import { t } from '@lingui/macro'; import { Link } from 'react-router-dom'; import { Badge, Switch } from '@patternfly/react-core'; class NotificationListItem extends React.Component { constructor (props) { super(props); this.errorToggleClick = this.errorToggleClick.bind(this); this.successToggleClick = this.successToggleClick.bind(this); } errorToggleClick (flag) { const { itemId, toggleError } = this.props; toggleError(itemId, flag); } successToggleClick (flag) { const { itemId, toggleSuccess } = this.props; toggleSuccess(itemId, flag); } render () { const { itemId, name, notificationType, detailUrl, parentBreadcrumb, successTurnedOn, errorTurnedOn } = this.props; const capText = { textTransform: 'capitalize' }; return ( {({ i18n }) => (
  • {name}
    {notificationType}
    this.successToggleClick(successTurnedOn)} aria-label={i18n._(t`Notification success toggle`)} /> this.errorToggleClick(errorTurnedOn)} aria-label={i18n._(t`Notification failure toggle`)} />
  • )}
    ); } } export default NotificationListItem;