@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
43 lines (36 loc) • 1.91 kB
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { styled } from '@mui/material/styles';
import Skeleton from '@mui/material/Skeleton';
import { Button, useTheme } from '@mui/material';
import BaseItem from '../../shared/BaseItem';
import { PREFIX } from './constants';
const classes = {
root: `${PREFIX}-skeleton-root`,
image: `${PREFIX}-image`,
primary: `${PREFIX}-primary`,
secondary: `${PREFIX}-secondary`,
button: `${PREFIX}-button`,
action: `${PREFIX}-action`
};
const Root = styled(BaseItem, {
name: PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS Category Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {CategorySkeleton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCCategory-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCCategory-skeleton-root|Styles applied to the root element.|
*
*/
export default function CategorySkeleton(props) {
const theme = useTheme();
return (_jsx(Root, Object.assign({ className: classes.root }, props, { image: _jsx(Skeleton, { animation: "wave", variant: "rectangular", width: theme.selfcommunity.category.icon.sizeMedium, height: theme.selfcommunity.category.icon.sizeMedium, className: classes.image }), primary: _jsx(Skeleton, { animation: "wave", height: 10, width: 120, className: classes.primary }), secondary: _jsx(Skeleton, { animation: "wave", height: 10, width: 70, className: classes.secondary }), actions: props.actions !== undefined ? (props.actions) : (_jsx(Button, Object.assign({ size: "small", variant: "outlined", disabled: true, className: classes.button }, { children: _jsx(Skeleton, { animation: "wave", height: 10, width: 50, className: classes.action }) }))) })));
}