UNPKG

1.27 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';
5export const NotificationDrawerListItem = (_a) => {
6 var { children = null, className = '', isHoverable = true, isRead = false,
7 // eslint-disable-next-line @typescript-eslint/no-unused-vars
8 onClick = (event) => undefined, tabIndex = 0, variant = 'default' } = _a, props = __rest(_a, ["children", "className", "isHoverable", "isRead", "onClick", "tabIndex", "variant"]);
9 const onKeyDown = (event) => {
10 // Accessibility function. Click on the list item when pressing Enter or Space on it.
11 if (event.key === 'Enter' || event.key === ' ') {
12 event.target.click();
13 }
14 };
15 return (React.createElement("li", Object.assign({}, props, { className: css(styles.notificationDrawerListItem, isHoverable && styles.modifiers.hoverable, styles.modifiers[variant], isRead && styles.modifiers.read, className), tabIndex: tabIndex, onClick: e => onClick(e), onKeyDown: onKeyDown }), children));
16};
17NotificationDrawerListItem.displayName = 'NotificationDrawerListItem';
18//# sourceMappingURL=NotificationDrawerListItem.js.map
\No newline at end of file