1 | import { __rest } from "tslib";
|
2 | import * as React from 'react';
|
3 | import { Button, ButtonVariant } from '../Button';
|
4 | import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
|
5 | import { AlertContext } from './AlertContext';
|
6 | export const AlertActionCloseButton = (_a) => {
|
7 | var {
|
8 |
|
9 | className = '', onClose = () => undefined, 'aria-label': ariaLabel = '', variantLabel } = _a, props = __rest(_a, ["className", "onClose", 'aria-label', "variantLabel"]);
|
10 | return (React.createElement(AlertContext.Consumer, null, ({ title, variantLabel: alertVariantLabel }) => (React.createElement(Button, Object.assign({ variant: ButtonVariant.plain, onClick: onClose, "aria-label": ariaLabel === '' ? `Close ${variantLabel || alertVariantLabel} alert: ${title}` : ariaLabel }, props),
|
11 | React.createElement(TimesIcon, null)))));
|
12 | };
|
13 | AlertActionCloseButton.displayName = 'AlertActionCloseButton';
|
14 |
|
\ | No newline at end of file |