import "choerodon-ui/pro/lib/spin/style";
import _Spin from "choerodon-ui/pro/lib/spin";
import React from 'react';
import { Permission } from '@choerodon/boot'; // @ts-ignore

import NoAccess from '@choerodon/master/lib/containers/components/c7n/tools/error-pages/403';
var defaultChildren = /*#__PURE__*/React.createElement("div", {
  style: {
    textAlign: 'center',
    paddingTop: 300
  }
}, /*#__PURE__*/React.createElement(_Spin, {
  size: 'large'
})); // eslint-disable-next-line max-len

var PermissionHOC = function PermissionHOC(permissions) {
  return function (Component) {
    return function (props) {
      return /*#__PURE__*/React.createElement(Permission, {
        service: permissions,
        defaultChildren: defaultChildren,
        noAccessChildren: /*#__PURE__*/React.createElement(NoAccess, null)
      }, /*#__PURE__*/React.createElement(Component, props));
    };
  };
};

export default PermissionHOC;