import React from 'react'; import PropTypes from 'prop-types'; import classNames from 'classnames'; import { translatable } from 'react-instantsearch-core'; import { createClassNames } from '../core/utils'; const cx = createClassNames('CurrentRefinements'); export const CurrentRefinements = ({ items, canRefine, refine, translate, className, }) => (
); const itemPropTypes = PropTypes.arrayOf( PropTypes.shape({ label: PropTypes.string.isRequired, value: PropTypes.func.isRequired, items: (...args) => itemPropTypes(...args), }) ); CurrentRefinements.propTypes = { items: itemPropTypes.isRequired, canRefine: PropTypes.bool.isRequired, refine: PropTypes.func.isRequired, translate: PropTypes.func.isRequired, className: PropTypes.string, }; CurrentRefinements.defaultProps = { className: '', }; export default translatable({ clearFilter: '✕', })(CurrentRefinements);