mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-11-24 09:25:15 +00:00
34 lines
1.1 KiB
JavaScript
34 lines
1.1 KiB
JavaScript
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
||
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
||
|
var _excluded = ["label", "onClick", "className"];
|
||
|
import PropTypes from 'prop-types';
|
||
|
import React from 'react';
|
||
|
import classNames from 'classnames';
|
||
|
var propTypes = {
|
||
|
label: PropTypes.string.isRequired,
|
||
|
onClick: PropTypes.func
|
||
|
};
|
||
|
var defaultProps = {
|
||
|
label: 'Close'
|
||
|
};
|
||
|
var CloseButton = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
|
||
|
var label = _ref.label,
|
||
|
onClick = _ref.onClick,
|
||
|
className = _ref.className,
|
||
|
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
||
|
|
||
|
return /*#__PURE__*/React.createElement("button", _extends({
|
||
|
ref: ref,
|
||
|
type: "button",
|
||
|
className: classNames('close', className),
|
||
|
onClick: onClick
|
||
|
}, props), /*#__PURE__*/React.createElement("span", {
|
||
|
"aria-hidden": "true"
|
||
|
}, "\xD7"), /*#__PURE__*/React.createElement("span", {
|
||
|
className: "sr-only"
|
||
|
}, label));
|
||
|
});
|
||
|
CloseButton.displayName = 'CloseButton';
|
||
|
CloseButton.propTypes = propTypes;
|
||
|
CloseButton.defaultProps = defaultProps;
|
||
|
export default CloseButton;
|