UNPKG

@selfcommunity/react-ui

Version:

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

42 lines (35 loc) 1.64 kB
import { jsx as _jsx } from "react/jsx-runtime"; import ListItem from '@mui/material/ListItem'; import ListItemText from '@mui/material/ListItemText'; import { styled } from '@mui/material/styles'; import Skeleton from '@mui/material/Skeleton'; import { useMediaQuery, useTheme } from '@mui/material'; import { PREFIX } from './constants'; const classes = { root: `${PREFIX}-skeleton-root`, list: `${PREFIX}-list` }; const Root = styled(ListItem, { name: PREFIX, slot: 'SkeletonRoot' })(() => ({})); /** * > API documentation for the Community-JS PrivateMessageThreadItem Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {PrivateMessageThreadItemSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCPrivateMessageThreadItem-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCPrivateMessageThreadItem-skeleton-root|Styles applied to the root element.| |list|.SCPrivateMessageThreadItem-list|Styles applied to the list element.| * */ export default function PrivateMessageThreadItemSkeleton(props) { const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('md')); return (_jsx(Root, Object.assign({ className: classes.root }, props, { children: _jsx(ListItemText, { sx: { display: 'flex', justifyContent: props.index % 2 === 0 ? 'flex-start' : 'flex-end' }, primary: _jsx(Skeleton, { animation: "wave", height: 100, width: isMobile ? 200 : 300, style: { borderRadius: theme.shape.borderRadius } }) }) }))); }