UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

42 lines (35 loc) 2.07 kB
import { __rest } from "tslib"; import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime"; import Widget from '../Widget'; import { CardContent, useTheme, Skeleton, styled } from '@mui/material'; import BaseItem from '../../shared/BaseItem'; import { PREFIX } from './constants'; const classes = { root: `${PREFIX}-skeleton-root`, avatar: `${PREFIX}-avatar`, primaryContent: `${PREFIX}-primary-content`, secondaryContent: `${PREFIX}-secondary-content` }; const Root = styled(BaseItem, { name: PREFIX, slot: 'SkeletonRoot' })(() => ({})); /** * > API documentation for the Community-JS Lesson Comment Object Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {LessonCommentObjectSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCLessonCommentObject-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCLessonCommentObject-skeleton-root|Styles applied to the root element.| * */ export default function LessonCommentObjectSkeleton(props) { const { WidgetProps } = props, rest = __rest(props, ["WidgetProps"]); const theme = useTheme(); return (_jsx(Root, Object.assign({ className: classes.root, disableTypography: true }, rest, { image: _jsx(Skeleton, { animation: "wave", variant: "circular", width: theme.selfcommunity.user.avatar.sizeMedium, height: theme.selfcommunity.user.avatar.sizeMedium, className: classes.avatar }), primary: _jsx(Skeleton, { animation: "wave", height: 10, width: "25%", className: classes.primaryContent }), secondary: _jsx(_Fragment, { children: _jsx(Widget, Object.assign({}, WidgetProps, { children: _jsxs(CardContent, Object.assign({ className: classes.secondaryContent }, { children: [_jsx(Skeleton, { animation: "wave", height: 10, width: "80%" }), _jsx(Skeleton, { animation: "wave", height: 10, width: "70%" }), _jsx(Skeleton, { animation: "wave", height: 10, width: "60%" })] })) })) }) }))); }