UNPKG

@pnp/spfx-controls-react

Version:

Reusable React controls for SharePoint Framework solutions

22 lines 1.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.RenderError = void 0; var tslib_1 = require("tslib"); var sp_core_library_1 = require("@microsoft/sp-core-library"); var DocumentCard_1 = require("@fluentui/react/lib/DocumentCard"); var Stack_1 = require("@fluentui/react/lib/Stack"); var React = tslib_1.__importStar(require("react")); var ErrorInfo_1 = require("../ErrorInfo"); var useListItemCommentsStyles_1 = require("./useListItemCommentsStyles"); var RenderError = function (props) { var _a = props.errorInfo || {}, showError = _a.showError, error = _a.error; var documentCardStyles = (0, useListItemCommentsStyles_1.useListItemCommentsStyles)().documentCardStyles; if (!showError) return null; return (React.createElement(DocumentCard_1.DocumentCard, { styles: documentCardStyles, key: "errorInfo" }, React.createElement(DocumentCard_1.DocumentCardDetails, { key: sp_core_library_1.Guid.newGuid().toString() }, React.createElement(Stack_1.Stack, { horizontal: true, horizontalAlign: "start", verticalAlign: "center", tokens: { padding: 5 }, key: sp_core_library_1.Guid.newGuid().toString() }, React.createElement(ErrorInfo_1.ErrorInfo, { showError: showError, error: error }))))); }; exports.RenderError = RenderError; //# sourceMappingURL=RenderError.js.map