1 line
6.0 KiB
JSON
1 line
6.0 KiB
JSON
|
{"ast":null,"code":"\"use client\";\n\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _callSuper from \"@babel/runtime/helpers/esm/callSuper\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport * as React from 'react';\nimport Alert from './Alert';\nlet ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n function ErrorBoundary() {\n var _this;\n _classCallCheck(this, ErrorBoundary);\n _this = _callSuper(this, ErrorBoundary, arguments);\n _this.state = {\n error: undefined,\n info: {\n componentStack: ''\n }\n };\n return _this;\n }\n _inherits(ErrorBoundary, _React$Component);\n return _createClass(ErrorBoundary, [{\n key: \"componentDidCatch\",\n value: function componentDidCatch(error, info) {\n this.setState({\n error,\n info\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n const {\n message,\n description,\n id,\n children\n } = this.props;\n const {\n error,\n info\n } = this.state;\n const componentStack = (info === null || info === void 0 ? void 0 : info.componentStack) || null;\n const errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;\n const errorDescription = typeof description === 'undefined' ? componentStack : description;\n if (error) {\n return /*#__PURE__*/React.createElement(Alert, {\n id: id,\n type: \"error\",\n message: errorMessage,\n description: /*#__PURE__*/React.createElement(\"pre\", {\n style: {\n fontSize: '0.9em',\n overflowX: 'auto'\n }\n }, errorDescription)\n });\n }\n return children;\n }\n }]);\n}(React.Component);\nexport default ErrorBoundary;","map":{"version":3,"names":["_classCallCheck","_createClass","_callSuper","_inherits","React","Alert","ErrorBoundary","_React$Component","_this","arguments","state","error","undefined","info","componentStack","key","value","componentDidCatch","setState","render","message","description","id","children","props","errorMessage","toString","errorDescription","createElement","type","style","fontSize","overflowX","Component"],"sources":["C:/Users/Аришина)/source/repos/PromoCursed/node_modules/antd/es/alert/ErrorBoundary.js"],"sourcesContent":["\"use client\";\n\nimport _classCallCheck from \"@babel/runtime/helpers/esm/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/esm/createClass\";\nimport _callSuper from \"@babel/runtime/helpers/esm/callSuper\";\nimport _inherits from \"@babel/runtime/helpers/esm/inherits\";\nimport * as React from 'react';\nimport Alert from './Alert';\nlet ErrorBoundary = /*#__PURE__*/function (_React$Component) {\n function ErrorBoundary() {\n var _this;\n _classCallCheck(this, ErrorBoundary);\n _this = _callSuper(this, ErrorBoundary, arguments);\n _this.state = {\n error: undefined,\n info: {\n componentStack: ''\n }\n };\n return _this;\n }\n _inherits(ErrorBoundary, _React$Component);\n return _createClass(ErrorBoundary, [{\n key: \"componentDidCatch\",\n value: function componentDidCatch(error, info) {\n this.setState({\n error,\n info\n });\n }\n }, {\n key: \"render\",\n value: function render() {\n const {\n message,\n description,\n id,\n children\n } = this.props;\n const {\n error,\n info\n } = this.state;\n const componentStack = (info === null || info === void 0 ? void 0 : info.componentStack) || null;\n const errorMessage = typeof message === 'undefined' ? (error || '').toString() : message;\n const errorDescription = typeof description === 'undefined' ? componentStack : description;\n if (error) {\n return /*#__PURE__*/React.createElement(Alert, {\n
|