mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 12:47:13 +01:00
More refactoring and clean-up.
This commit is contained in:
parent
f062cdbed2
commit
c815e7cd51
16 changed files with 101 additions and 134 deletions
|
|
@ -1,24 +1,11 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import ButtonLayout from 'components/layout/ButtonLayout';
|
||||
import { ButtonGroup } from 'react-basics';
|
||||
import { ButtonGroup, Button, Flexbox } from 'react-basics';
|
||||
|
||||
function FilterButtons({ buttons, selected, onClick }) {
|
||||
export default function FilterButtons({ items, selected, onSelect }) {
|
||||
return (
|
||||
<ButtonLayout>
|
||||
<ButtonGroup size="xsmall" items={buttons} selectedItem={selected} onClick={onClick} />
|
||||
</ButtonLayout>
|
||||
<Flexbox justifyContent="center">
|
||||
<ButtonGroup items={items} selectedKey={selected} onSelect={onSelect}>
|
||||
{({ key, label }) => <Button key={key}>{label}</Button>}
|
||||
</ButtonGroup>
|
||||
</Flexbox>
|
||||
);
|
||||
}
|
||||
|
||||
FilterButtons.propTypes = {
|
||||
buttons: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
label: PropTypes.node,
|
||||
value: PropTypes.any.isRequired,
|
||||
}),
|
||||
),
|
||||
selected: PropTypes.any,
|
||||
onClick: PropTypes.func,
|
||||
};
|
||||
|
||||
export default FilterButtons;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue