UNPKG

1.02 kBJavaScriptView Raw
1import { __rest } from "tslib";
2import * as React from 'react';
3import { Button, ButtonVariant } from '../Button';
4import TimesIcon from '@patternfly/react-icons/dist/esm/icons/times-icon';
5import { AlertContext } from './AlertContext';
6export const AlertActionCloseButton = (_a) => {
7 var {
8 // eslint-disable-next-line @typescript-eslint/no-unused-vars
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};
13AlertActionCloseButton.displayName = 'AlertActionCloseButton';
14//# sourceMappingURL=AlertActionCloseButton.js.map
\No newline at end of file