import React from 'react';
import PropTypes from 'prop-types';
import { Component } from '@core/utils/BEM';

// Style
/* istanbul ignore next */
if (typeof window !== 'undefined') require('./style.scss');

export default class Box extends Component {
  static propTypes = {
    ...Component.propTypes,
    tag: PropTypes.oneOfType([PropTypes.func, PropTypes.string, PropTypes.element, PropTypes.elementType]),
  };

  static defaultProps = {
    bem: [['flat']],
    tag: 'div',
  };

  constructor(props) {
    super(props, 'Box');
  }

  render() {
    const props = this.props;
    return (
      <div {...props} className={this.bem.classes()}>
        {props.children}
      </div>
    );
  }
}
