diff --git a/components/common/ButtonGroup.js b/components/common/ButtonGroup.js index c91bb743..353ce690 100644 --- a/components/common/ButtonGroup.js +++ b/components/common/ButtonGroup.js @@ -1,16 +1,10 @@ import React from 'react'; +import PropTypes from 'prop-types'; import classNames from 'classnames'; import Button from './Button'; import styles from './ButtonGroup.module.css'; -export default function ButtonGroup({ - items = [], - selectedItem, - className, - size, - icon, - onClick = () => {}, -}) { +function ButtonGroup({ items = [], selectedItem, className, size, icon, onClick = () => {} }) { return (
{items.map(item => { @@ -30,3 +24,19 @@ export default function ButtonGroup({
); } + +ButtonGroup.propTypes = { + items: PropTypes.arrayOf( + PropTypes.shape({ + label: PropTypes.node, + value: PropTypes.any.isRequired, + }), + ), + selectedItem: PropTypes.any, + className: PropTypes.string, + size: PropTypes.oneOf(['xlarge', 'large', 'medium', 'small', 'xsmall']), + icon: PropTypes.node, + onClick: PropTypes.func, +}; + +export default ButtonGroup;