UNPKG

1.7 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import { css } from '@patternfly/react-styles';
4import styles from '@patternfly/react-styles/css/components/NotificationDrawer/notification-drawer';
5import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
6import { Text, TextVariants } from '../Text';
7import { Button, ButtonVariant } from '../Button';
8export const NotificationDrawerHeader = (_a) => {
9 var { children, className = '', count, closeButtonAriaLabel = 'Close', customText, onClose, title = 'Notifications', unreadText = 'unread' } = _a, props = __rest(_a, ["children", "className", "count", "closeButtonAriaLabel", "customText", "onClose", "title", "unreadText"]);
10 return (React.createElement("div", Object.assign({}, props, { className: css(styles.notificationDrawerHeader, className) }),
11 React.createElement(Text, { component: TextVariants.h1, className: css(styles.notificationDrawerHeaderTitle) }, title),
12 (customText !== undefined || count !== undefined) && (React.createElement("span", { className: css(styles.notificationDrawerHeaderStatus) }, customText || `${count} ${unreadText}`)),
13 (children || onClose) && (React.createElement("div", { className: css(styles.notificationDrawerHeaderAction) },
14 children,
15 onClose && (React.createElement("div", null,
16 React.createElement(Button, { variant: ButtonVariant.plain, "aria-label": closeButtonAriaLabel, onClick: onClose },
17 React.createElement(TimesIcon, { "aria-hidden": "true" }))))))));
18};
19NotificationDrawerHeader.displayName = 'NotificationDrawerHeader';
20//# sourceMappingURL=NotificationDrawerHeader.js.map
\No newline at end of file