@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
42 lines (35 loc) • 2.01 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { styled } from '@mui/material/styles';
import { Box, Card, CardContent, ListSubheader, Skeleton, useMediaQuery, useTheme } from '@mui/material';
import List from '@mui/material/List';
import PrivateMessageThreadItemSkeleton from '../PrivateMessageThreadItem/Skeleton';
import { PREFIX } from './constants';
const classes = {
root: `${PREFIX}-skeleton-root`,
list: `${PREFIX}-list`,
editor: `${PREFIX}-editor`
};
const Root = styled(Card, {
name: PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS PrivateMessage Thread Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {PrivateMessageThreadSkeleton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCPrivateMessageThread-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCPrivateMessageThread-skeleton-root|Styles applied to the root element.|
|list|.SCPrivateMessageThread-list|Styles applied to the list element.|
*
*/
export default function PrivateMessageThreadSkeleton(props) {
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('sm'));
return (_jsx(Root, Object.assign({ className: classes.root }, props, { children: _jsxs(CardContent, { children: [_jsxs(List, Object.assign({ className: classes.list }, { children: [_jsx(ListSubheader, Object.assign({ sx: { display: 'flex', justifyContent: 'center' } }, { children: _jsx(Skeleton, { animation: "wave", height: 30, width: 120, style: { borderRadius: 20 } }) })), [...Array(isMobile ? 6 : 8)].map((item, index) => (_jsx(PrivateMessageThreadItemSkeleton, { index: index }, index)))] })), _jsx(Box, Object.assign({ className: classes.editor }, { children: _jsx(Skeleton, { animation: "wave", height: 55, width: '100%', variant: 'rectangular' }) }))] }) })));
}