Debian Codegraph @

node/@patternfly/react-core/dist/esm/components/NotificationDrawer/NotificationDrawerHeader.js

raw
1 import { __rest } from "tslib";
2 import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3 import { css } from '@patternfly/react-styles';
4 import styles from '@patternfly/react-styles/css/components/NotificationDrawer/notification-drawer.mjs';
5 import RhMicronsCloseIcon from '@patternfly/react-icons/dist/esm/icons/rh-microns-close-icon';
6 import { Button, ButtonVariant } from '../Button';
7 export const NotificationDrawerHeader = (_a) => {
8 var { children, className = '', count, closeButtonAriaLabel = 'Close', customText, onClose, title = 'Notifications', unreadText = 'unread' } = _a, props = __rest(_a, ["children", "className", "count", "closeButtonAriaLabel", "customText", "onClose", "title", "unreadText"]);
9 return (_jsxs("div", Object.assign({}, props, { className: css(styles.notificationDrawerHeader, className), children: [_jsx("h1", { className: css(styles.notificationDrawerHeaderTitle), children: title }), (customText !== undefined || count !== undefined) && (_jsx("span", { className: css(styles.notificationDrawerHeaderStatus), "aria-live": "polite", children: customText || `${count} ${unreadText}` })), (children || onClose) && (_jsxs("div", { className: css(styles.notificationDrawerHeaderAction), children: [children, onClose && (_jsx("div", { children: _jsx(Button, { variant: ButtonVariant.plain, "aria-label": closeButtonAriaLabel, onClick: (event) => onClose(event), icon: _jsx(RhMicronsCloseIcon, {}) }) }))] }))] })));
10 };
11 NotificationDrawerHeader.displayName = 'NotificationDrawerHeader';
12 //# sourceMappingURL=NotificationDrawerHeader.js.map