1 | import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
2 | import { jsx as _jsx } from "react/jsx-runtime";
|
3 | import { ErrorBoundary } from '@ant-design/pro-utils';
|
4 | import { Layout } from 'antd';
|
5 | import classNames from 'classnames';
|
6 | import { useContext } from 'react';
|
7 | import { ProProvider } from '@ant-design/pro-provider';
|
8 | var 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 | };
|
31 | export { WrapContent }; |
\ | No newline at end of file |