function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }

import React from 'react';
import { Box, Button, Icon } from '../../primitives';
import { AlertContext } from './index';
import { omitUndefined } from '../../../theme/tools/utils';

const AlertCloseButton = ({
  children,
  ...props
}) => {
  const newProps = omitUndefined(props);
  const {
    iconColor
  } = React.useContext(AlertContext);
  return /*#__PURE__*/React.createElement(Box, {
    position: "absolute",
    top: 3,
    right: 3
  }, /*#__PURE__*/React.createElement(Button, _extends({
    variant: "unstyled"
  }, newProps), children || /*#__PURE__*/React.createElement(Icon, {
    name: "close",
    type: "MaterialCommunityIcons",
    color: iconColor,
    size: 6
  })));
};

export default AlertCloseButton;
//# sourceMappingURL=AlertCloseButton.js.map