UNPKG

@carbon/ibm-security

Version:

Carbon for Cloud & Cognitive IBM Security UI components

53 lines (52 loc) 1.92 kB
import _extends from "@babel/runtime/helpers/extends"; /** * @file Header notification. * @copyright IBM Security 2018 - 2021 */ import { Close20 } from '@carbon/icons-react'; import React from 'react'; import Icon from '../../Icon'; import StringFormatter from '../../StringFormatter'; import { namespace, propTypes } from './constants'; var HeaderNotification = function HeaderNotification(_ref) { var clearButtonLabel = _ref.clearButtonLabel, dateTime = _ref.dateTime, description = _ref.description, onClearButtonClick = _ref.onClearButtonClick, product = _ref.product, viaLabel = _ref.viaLabel, href = _ref.href, tooltipDirection = _ref.tooltipDirection; return /*#__PURE__*/React.createElement("div", { className: namespace, role: "alert" }, /*#__PURE__*/React.createElement("a", _extends({}, href ? { href: href } : {}, { className: "".concat(namespace, "__content") }), /*#__PURE__*/React.createElement("span", { className: "".concat(namespace, "__details") }, /*#__PURE__*/React.createElement("time", { className: "".concat(namespace, "__time"), dateTime: dateTime }, /*#__PURE__*/React.createElement("isc-rel-time", { datetime: dateTime })), " ".concat(viaLabel, " ").concat(product)), /*#__PURE__*/React.createElement(StringFormatter, { className: "".concat(namespace, "__description"), lines: 2, truncate: true, value: description, tooltipDirection: tooltipDirection })), /*#__PURE__*/React.createElement("div", { className: "".concat(namespace, "__wrapper") }, /*#__PURE__*/React.createElement("button", { className: "".concat(namespace, "__button"), "aria-label": clearButtonLabel, onClick: onClearButtonClick, type: "button" }, /*#__PURE__*/React.createElement(Icon, { renderIcon: Close20 })))); }; HeaderNotification.propTypes = propTypes; export default HeaderNotification;