@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
27 lines (26 loc) • 1.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const material_1 = require("@mui/material");
const react_intl_1 = require("react-intl");
const react_1 = require("react");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const PREFIX = 'SCEmptyStatus';
const classes = {
root: `${PREFIX}-root`,
box: `${PREFIX}-box`,
rotatedBox: `${PREFIX}-rotated-box`,
icon: `${PREFIX}-icon`
};
const Root = (0, material_1.styled)(material_1.Stack, {
name: PREFIX,
slot: 'Root',
overridesResolver: (_props, styles) => styles.root
})(() => ({}));
function EmptyStatus(props) {
// PROPS
const { icon, title, description, actions, className } = props;
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.box }, { children: (0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ className: classes.rotatedBox }, { children: (0, jsx_runtime_1.jsx)(material_1.Icon, Object.assign({ className: classes.icon, color: "disabled", fontSize: "large" }, { children: icon })) })) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), description && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: description, defaultMessage: description }) }))), actions] })));
}
exports.default = (0, react_1.memo)(EmptyStatus);