'use strict';

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

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _reactIntl = require('react-intl');

var _reactRedux = require('react-redux');

var _ConfigProvider = require('./config/ConfigProvider');

var _ConfigProvider2 = _interopRequireDefault(_ConfigProvider);

var _RouterContainer = require('../containers/RouterContainer');

var _RouterContainer2 = _interopRequireDefault(_RouterContainer);

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

var propTypes = {
  store: _react.PropTypes.object.isRequired,
  history: _react.PropTypes.object.isRequired,
  className: _react.PropTypes.string,
  config: _react.PropTypes.object
};

var defaultProps = {
  locale: 'en'
};

function App(props) {
  var className = props.className,
      config = props.config,
      history = props.history,
      store = props.store;
  var index = config.index,
      locale = config.locale,
      messages = config.messages;


  return _react2.default.createElement(
    _reactIntl.IntlProvider,
    { locale: locale, messages: messages },
    _react2.default.createElement(
      _reactRedux.Provider,
      { store: store },
      _react2.default.createElement(
        _ConfigProvider2.default,
        { config: config },
        _react2.default.createElement(_RouterContainer2.default, {
          className: className,
          history: history,
          index: index
        })
      )
    )
  );
}

App.propTypes = propTypes;
App.defaultProps = defaultProps;