import React from 'react';
import PropTypes from 'prop-types';
import ClassNames from 'classnames';
import './bar.scss';

const propTypes = {
  /** @ignore */
  className: PropTypes.string,
  justify: PropTypes.oneOf(['left', 'center', 'right'])
};

const defaultProps = {
  className: undefined,
  justify: null
};

const Bar = ({ justify, className, ...props }) => (
  <div
    styleName={ClassNames(
      'base', { [`justify-${justify}`]: justify }
    )}
    className={className}
    {...props}
  />
);

Bar.propTypes = propTypes;
Bar.defaultProps = defaultProps;

export default Bar;
