@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
41 lines (34 loc) • 1.99 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import CardContent from '@mui/material/CardContent';
import { styled } from '@mui/material/styles';
import { CardHeader, useTheme } from '@mui/material';
import Skeleton from '@mui/material/Skeleton';
import Widget from '../Widget';
import { PREFIX } from './constants';
const classes = {
root: `${PREFIX}-skeleton-root`
};
const Root = styled(Widget, {
name: PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS Notification Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {NotificationSkeleton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCNotification-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCNotification-skeleton-root|Styles applied to the root element.|
*
*/
export default function NotificationSkeleton(props) {
const theme = useTheme();
const notification = (_jsx(_Fragment, { children: _jsx(CardHeader, { avatar: _jsx(Skeleton, { animation: "wave", variant: "circular", width: theme.selfcommunity.user.avatar.sizeMedium, height: theme.selfcommunity.user.avatar.sizeMedium }), title: _jsx(Skeleton, { animation: "wave", height: 10, width: "80%", style: { marginBottom: 6 } }), subheader: _jsx(Skeleton, { animation: "wave", height: 10, width: "40%" }) }) }));
return (_jsxs(Root, Object.assign({ className: classes.root }, props, { children: [_jsxs(CardContent, Object.assign({ sx: { paddingBottom: 1 } }, { children: [_jsx(Skeleton, { animation: "wave", height: 20, style: { marginBottom: 0 } }), _jsx(Skeleton, { animation: "wave", height: 15, width: "60%", style: { marginBottom: 0 } })] })), [...Array(Math.floor(Math.random() * 5) + 1)].map((x, i) => (_jsx(React.Fragment, { children: notification }, i)))] })));
}