| 1 |
"use strict"; |
| 2 |
Object.defineProperty(exports, "__esModule", { value: true }); |
| 3 |
exports.NotificationDrawerHeader = void 0; |
| 4 |
const tslib_1 = require("tslib"); |
| 5 |
const jsx_runtime_1 = require("react/jsx-runtime"); |
| 6 |
const react_styles_1 = require("@patternfly/react-styles"); |
| 7 |
const notification_drawer_1 = tslib_1.__importDefault(require("@patternfly/react-styles/css/components/NotificationDrawer/notification-drawer")); |
| 8 |
const rh_microns_close_icon_1 = tslib_1.__importDefault(require('@patternfly/react-icons/dist/js/icons/rh-microns-close-icon')); |
| 9 |
const Button_1 = require("../Button"); |
| 10 |
const NotificationDrawerHeader = (_a) => { |
| 11 |
var { children, className = '', count, closeButtonAriaLabel = 'Close', customText, onClose, title = 'Notifications', unreadText = 'unread' } = _a, props = tslib_1.__rest(_a, ["children", "className", "count", "closeButtonAriaLabel", "customText", "onClose", "title", "unreadText"]); |
| 12 |
return ((0, jsx_runtime_1.jsxs)("div", Object.assign({}, props, { className: (0, react_styles_1.css)(notification_drawer_1.default.notificationDrawerHeader, className), children: [(0, jsx_runtime_1.jsx)("h1", { className: (0, react_styles_1.css)(notification_drawer_1.default.notificationDrawerHeaderTitle), children: title }), (customText !== undefined || count !== undefined) && ((0, jsx_runtime_1.jsx)("span", { className: (0, react_styles_1.css)(notification_drawer_1.default.notificationDrawerHeaderStatus), "aria-live": "polite", children: customText || `${count} ${unreadText}` })), (children || onClose) && ((0, jsx_runtime_1.jsxs)("div", { className: (0, react_styles_1.css)(notification_drawer_1.default.notificationDrawerHeaderAction), children: [children, onClose && ((0, jsx_runtime_1.jsx)("div", { children: (0, jsx_runtime_1.jsx)(Button_1.Button, { variant: Button_1.ButtonVariant.plain, "aria-label": closeButtonAriaLabel, onClick: (event) => onClose(event), icon: (0, jsx_runtime_1.jsx)(rh_microns_close_icon_1.default, {}) }) }))] }))] }))); |
| 13 |
}; |
| 14 |
exports.NotificationDrawerHeader = NotificationDrawerHeader; |
| 15 |
exports.NotificationDrawerHeader.displayName = 'NotificationDrawerHeader'; |
| 16 |
//# sourceMappingURL=NotificationDrawerHeader.js.map |