import PropTypes from 'prop-types';
import classNames from 'classnames';
import './button-group.css';

function ButtonGroup(props) {
  return (
    <div
      className={classNames(
        'btn-group flex',
        { 'btn-group-stretched': props.float },
        props.className
      )}
    >
      {props.children}
    </div>
  );
}

ButtonGroup.defaultProps = { float: false };

ButtonGroup.propTypes = {
  float: PropTypes.bool.isRequired,
  children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)]),
  className: PropTypes.string
};

export default ButtonGroup;
