import React from 'react'; import PropTypes from 'prop-types'; import { IconText, IconWrapper } from '@buffetjs/styles'; import Icon from '../Icon'; function PrefixIcon(_ref) { var type = _ref.type, icon = _ref.icon; if (icon) { return /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(Icon, { icon: icon })); } if (type === 'search') { return /*#__PURE__*/React.createElement(IconWrapper, null, /*#__PURE__*/React.createElement(Icon, { icon: type })); } if (type === 'email') { return /*#__PURE__*/React.createElement(IconText, { text: "@" }); } return null; } PrefixIcon.defaultProps = { icon: null }; PrefixIcon.propTypes = { icon: PropTypes.node, type: PropTypes.string.isRequired }; export default PrefixIcon;