UNPKG

@selfcommunity/react-ui

Version:

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

45 lines (38 loc) 1.59 kB
import { __rest } from "tslib"; import { jsx as _jsx } from "react/jsx-runtime"; import { styled } from '@mui/material/styles'; import { Avatar, AvatarGroup, Skeleton, useTheme } from '@mui/material'; import { useThemeProps } from '@mui/system'; const PREFIX = 'SCAvatarGroupSkeleton'; const classes = { root: `${PREFIX}-root` }; const Root = styled(AvatarGroup, { name: PREFIX, slot: 'Root', overridesResolver: (_props, styles) => styles.root })(() => ({})); /** * > API documentation for the Community-JS Avatar Group Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {AvatarGroupSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCAvatarGroupSkeleton` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCAvatarGroupSkeleton-root|Styles applied to the root element.| * */ export default function AvatarGroupSkeleton(inProps) { // PROPS const props = useThemeProps({ props: inProps, name: PREFIX }); const { skeletonsAnimation = 'wave', count = 3 } = props, rest = __rest(props, ["skeletonsAnimation", "count"]); const theme = useTheme(); return (_jsx(Root, Object.assign({ className: classes.root }, rest, { children: [...Array(count)].map((_x, i) => (_jsx(Avatar, { children: _jsx(Skeleton, { variant: "circular", width: theme.selfcommunity.user.avatar.sizeSmall, height: theme.selfcommunity.user.avatar.sizeSmall, animation: skeletonsAnimation }) }, i))) }))); }