mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
feature(components): prop-type FilterButtons
This commit is contained in:
parent
9ab3d36ced
commit
933a7f37e6
@ -1,11 +1,25 @@
|
|||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import PropTypes from 'prop-types';
|
||||||
import ButtonLayout from 'components/layout/ButtonLayout';
|
import ButtonLayout from 'components/layout/ButtonLayout';
|
||||||
import ButtonGroup from './ButtonGroup';
|
import ButtonGroup from './ButtonGroup';
|
||||||
|
|
||||||
export default function FilterButtons({ buttons, selected, onClick }) {
|
function FilterButtons({ buttons, selected, onClick }) {
|
||||||
return (
|
return (
|
||||||
<ButtonLayout>
|
<ButtonLayout>
|
||||||
<ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />
|
<ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />
|
||||||
</ButtonLayout>
|
</ButtonLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FilterButtons.propTypes = {
|
||||||
|
buttons: PropTypes.arrayOf(
|
||||||
|
PropTypes.shape({
|
||||||
|
label: PropTypes.node,
|
||||||
|
value: PropTypes.any.isRequired,
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
selected: PropTypes.any,
|
||||||
|
onClick: PropTypes.func,
|
||||||
|
};
|
||||||
|
|
||||||
|
export default FilterButtons;
|
||||||
|
Loading…
Reference in New Issue
Block a user