blob: f95c35fad73d86561a42dfe5c16f9315c134e0d5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
import classNames from 'classnames';
import PropTypes from 'prop-types';
import React from 'react';
const FilterButton = ({active, children, onClick}) => (
<button className={classNames("btn btn-secondary", {"active": active})}
onClick={() => {
if (!active) {
onClick();
}
}}>
{children}
</button>
);
FilterButton.propTypes = {
active: PropTypes.bool.isRequired,
children: PropTypes.node.isRequired,
onClick: PropTypes.func.isRequired
};
export default FilterButton;
|