import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
var _excluded = ["title", "children", "direction", "style"];
import * as React from 'react';
import { Card } from 'react-vant';
import "./index.scss";

/**
 * 由 Card 组成的 container 容器
 * @param title
 * @param children
 * @param otherProps
 * @constructor
 */
var JContainer = function JContainer(_ref) {
  var title = _ref.title,
      children = _ref.children,
      _ref$direction = _ref.direction,
      direction = _ref$direction === void 0 ? 'column' : _ref$direction,
      _ref$style = _ref.style,
      style = _ref$style === void 0 ? {} : _ref$style,
      otherProps = _objectWithoutPropertiesLoose(_ref, _excluded);

  var _style = style || {};

  _style.flexDirection = direction;

  var _otherProps = otherProps || {};

  _otherProps.style = _style;
  return /*#__PURE__*/React.createElement(Card, null, title && /*#__PURE__*/React.createElement(Card.Header, null, title), /*#__PURE__*/React.createElement(Card.Body, null, /*#__PURE__*/React.createElement("div", _extends({
    className: 'container-wrapper'
  }, _otherProps), children)));
};

export default JContainer;