Devendra174's picture
Upload folder using huggingface_hub
1e92f2d verified
raw
history blame
1.02 kB
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
import { createClassNames } from '../core/utils';
import Select from './Select';
const cx = createClassNames('SortBy');
class SortBy extends Component {
static propTypes = {
id: PropTypes.string,
items: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.string,
value: PropTypes.string.isRequired,
})
).isRequired,
currentRefinement: PropTypes.string.isRequired,
refine: PropTypes.func.isRequired,
className: PropTypes.string,
};
static defaultProps = {
className: '',
};
render() {
const { id, items, currentRefinement, refine, className } = this.props;
return (
<div className={classNames(cx(''), className)}>
<Select
id={id}
cx={cx}
items={items}
selectedItem={currentRefinement}
onSelect={refine}
/>
</div>
);
}
}
export default SortBy;