"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));

var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));

var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));

var _react = _interopRequireDefault(require("react"));

var _propTypes = _interopRequireDefault(require("prop-types"));

var _useTheme2 = _interopRequireDefault(require("../hooks/useTheme"));

var _Box = _interopRequireDefault(require("../Box"));

var Container = function Container(_ref) {
  var fullWidth = _ref.fullWidth,
      rest = (0, _objectWithoutProperties2["default"])(_ref, ["fullWidth"]);

  var _useTheme = (0, _useTheme2["default"])(),
      _useTheme$grid = _useTheme.grid;

  _useTheme$grid = _useTheme$grid === void 0 ? {} : _useTheme$grid;
  var _useTheme$grid$gutter = _useTheme$grid.gutters,
      gutters = _useTheme$grid$gutter === void 0 ? 2 : _useTheme$grid$gutter,
      breakpoints = _useTheme.breakpoints;
  return /*#__PURE__*/_react["default"].createElement(_Box["default"], (0, _extends2["default"])({
    px: gutters,
    mx: "auto",
    width: 1,
    sx: {
      maxWidth: fullWidth || !breakpoints ? 'none' : ['none'].concat((0, _toConsumableArray2["default"])(breakpoints))
    }
  }, rest));
};

process.env.NODE_ENV !== "production" ? Container.propTypes = {
  fullWidth: _propTypes["default"].bool
} : void 0;
var _default = Container;
exports["default"] = _default;