@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
46 lines (39 loc) • 2.32 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const Widget_1 = tslib_1.__importDefault(require("../Widget"));
const styles_1 = require("@mui/material/styles");
const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton"));
const material_1 = require("@mui/material");
const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem"));
const constants_1 = require("./constants");
const classes = {
root: `${constants_1.PREFIX}-skeleton-root`,
avatar: `${constants_1.PREFIX}-avatar`,
primaryContent: `${constants_1.PREFIX}-primary-content`
};
const Root = (0, styles_1.styled)(BaseItem_1.default, {
name: constants_1.PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS Comment Object Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {CommentObjectSkeleton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCCommentObject-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCCommentObject-skeleton-root|Styles applied to the root element.|
*
*/
function CommentObjectSkeleton(props) {
const { WidgetProps } = props, rest = tslib_1.__rest(props, ["WidgetProps"]);
const theme = (0, material_1.useTheme)();
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root, disableTypography: true }, rest, { image: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: theme.selfcommunity.user.avatar.sizeMedium, height: theme.selfcommunity.user.avatar.sizeMedium, className: classes.avatar }), secondary: (0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(Widget_1.default, Object.assign({}, WidgetProps, { children: (0, jsx_runtime_1.jsxs)(material_1.CardContent, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "80%", className: classes.primaryContent }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "40%" })] }) })) }) })));
}
exports.default = CommentObjectSkeleton;