UNPKG

1.4 kBJavaScriptView Raw
1import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2import { jsx as _jsx } from "react/jsx-runtime";
3import { ErrorBoundary } from '@ant-design/pro-utils';
4import { Layout } from 'antd';
5import classNames from 'classnames';
6import { useContext } from 'react';
7import { ProProvider } from '@ant-design/pro-provider';
8var WrapContent = function WrapContent(props) {
9 var _classNames;
10 var _useContext = useContext(ProProvider),
11 hashId = _useContext.hashId;
12 var style = props.style,
13 prefixCls = props.prefixCls,
14 children = props.children,
15 _props$hasPageContain = props.hasPageContainer,
16 hasPageContainer = _props$hasPageContain === void 0 ? 0 : _props$hasPageContain;
17 var contentClassName = classNames("".concat(prefixCls, "-content"), hashId, (_classNames = {}, _defineProperty(_classNames, "".concat(prefixCls, "-has-header"), props.hasHeader), _defineProperty(_classNames, "".concat(prefixCls, "-content-has-page-container"), hasPageContainer > 0), _classNames));
18 var ErrorComponent = props.ErrorBoundary || ErrorBoundary;
19 return props.ErrorBoundary === false ? _jsx(Layout.Content, {
20 className: contentClassName,
21 style: style,
22 children: children
23 }) : _jsx(ErrorComponent, {
24 children: _jsx(Layout.Content, {
25 className: contentClassName,
26 style: style,
27 children: children
28 })
29 });
30};
31export { WrapContent };
\No newline at end of file