2021-02-16 13:07:59 +01:00
|
|
|
import PropTypes from 'prop-types';
|
2020-10-13 01:31:51 +02:00
|
|
|
import ButtonLayout from 'components/layout/ButtonLayout';
|
2022-12-27 01:57:59 +01:00
|
|
|
import { ButtonGroup } from 'react-basics';
|
2020-10-13 01:31:51 +02:00
|
|
|
|
2021-02-16 13:07:59 +01:00
|
|
|
function FilterButtons({ buttons, selected, onClick }) {
|
2020-10-13 01:31:51 +02:00
|
|
|
return (
|
|
|
|
<ButtonLayout>
|
|
|
|
<ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />
|
|
|
|
</ButtonLayout>
|
|
|
|
);
|
|
|
|
}
|
2021-02-16 13:07:59 +01:00
|
|
|
|
|
|
|
FilterButtons.propTypes = {
|
|
|
|
buttons: PropTypes.arrayOf(
|
|
|
|
PropTypes.shape({
|
|
|
|
label: PropTypes.node,
|
|
|
|
value: PropTypes.any.isRequired,
|
|
|
|
}),
|
|
|
|
),
|
|
|
|
selected: PropTypes.any,
|
|
|
|
onClick: PropTypes.func,
|
|
|
|
};
|
|
|
|
|
|
|
|
export default FilterButtons;
|