"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports["default"] = void 0;
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _drawer = _interopRequireDefault(require("@alifd/next/lib/drawer"));
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
var React = _interopRequireWildcard(require("react"));
require("./index.scss");
var _excluded = ["visible", "title", "placement", "actions", "children", "onClick"];
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
var Drawer = function Drawer(_ref) {
  var visible = _ref.visible,
    title = _ref.title,
    placement = _ref.placement,
    actions = _ref.actions,
    children = _ref.children,
    onClick = _ref.onClick,
    otherProps = (0, _objectWithoutPropertiesLoose2["default"])(_ref, _excluded);
  var _otherProps = otherProps || {};
  return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
    className: "drawer"
  }, _otherProps), /*#__PURE__*/React.createElement(_drawer["default"], {
    visible: visible,
    title: title,
    placement: placement
  }, children, /*#__PURE__*/React.createElement("div", {
    className: "drawer-actions",
    style: {
      display: 'flex',
      alignItems: 'center',
      justifyContent: 'space-between',
      gap: '16px',
      padding: '16px'
    }
  }, actions && actions.map(function (action, index) {
    return /*#__PURE__*/React.createElement("div", {
      key: index,
      className: "drawer-action"
    }, /*#__PURE__*/React.createElement(_button["default"], {
      type: action.style,
      onClick: action.action
    }, action.text));
  }))));
};
Drawer.displayName = 'CustomDrawer';
var _default = exports["default"] = Drawer;