'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _classnames = require('classnames');

var _classnames2 = _interopRequireDefault(_classnames);

var _pxDataTable = require('./px-data-table.scss');

var _pxDataTable2 = _interopRequireDefault(_pxDataTable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

exports.default = function (_ref) {
  var _ref$label = _ref.label,
      label = _ref$label === undefined ? 'DataTable' : _ref$label,
      children = _ref.children;

  var baseClasses = (0, _classnames2.default)('px-data-table', {
    'px-datatable--children': children
  });

  return _react2.default.createElement(
    'div',
    { className: baseClasses },
    _react2.default.createElement(
      'h4',
      null,
      label
    ),
    _react2.default.createElement(
      'div',
      null,
      children
    ),
    _react2.default.createElement(
      'style',
      { jsx: true },
      _pxDataTable2.default
    )
  );
};