import _keys from "lodash/fp/keys";
import React from 'react';
import PropTypes from 'prop-types';
import classnames from 'classnames';
import Icon from '../icon';
import style from './style.css';
const TAG_STYLES = {
  default: style.defaultStyle,
  success: style.success,
  failure: style.failure,
  warning: style.warning,
  progress: style.progress,
  info: style.info
};
const TAG_SIZE = {
  S: style.small,
  M: style.medium,
  L: style.large
};
const Tag = ({
  label,
  type = 'default',
  size = 'M',
  customStyle = {},
  icon = {}
}) => {
  const {
    position,
    ...iconProps
  } = icon;
  return /*#__PURE__*/React.createElement("span", {
    className: classnames(TAG_STYLES[type], TAG_SIZE[size]),
    "data-name": `content-tag-${label}`,
    style: customStyle
  }, /*#__PURE__*/React.createElement("div", {
    className: style.content
  }, position === 'left' ? /*#__PURE__*/React.createElement(Icon, iconProps) : null, /*#__PURE__*/React.createElement("div", null, label), position === 'right' ? /*#__PURE__*/React.createElement(Icon, iconProps) : null));
};
Tag.propTypes = process.env.NODE_ENV !== "production" ? {
  label: PropTypes.string,
  type: PropTypes.oneOf(_keys(TAG_STYLES)),
  size: PropTypes.oneOf(['S', 'M', 'L']),
  customStyle: PropTypes.objectOf(PropTypes.oneOfType([PropTypes.string, PropTypes.number])),
  icon: PropTypes.shape({
    ...Icon.propTypes,
    position: PropTypes.oneOf(['left', 'right'])
  })
} : {};
export default Tag;
//# sourceMappingURL=index.js.map