UNPKG

@selfcommunity/react-ui

Version:

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

42 lines (35 loc) 2.09 kB
import { __rest } from "tslib"; import { jsx as _jsx } from "react/jsx-runtime"; import { PREFIX } from './constants'; import { Box, Grid, styled } from '@mui/material'; import classNames from 'classnames'; import { CourseSkeleton } from '../Course'; import CourseCreatePlaceholder from '../Course/CreatePlaceholder'; const classes = { root: `${PREFIX}-skeleton-root`, courses: `${PREFIX}-skeleton-courses`, item: `${PREFIX}-skeleton-item` }; const Root = styled(Box, { name: PREFIX, slot: 'SkeletonRoot' })(() => ({})); /**https://www.figma.com/design/bm7N6ykMLLmaAA22g34bRY/Corsi?t=HKaD6ErrzGpYDJr1-0 * > API documentation for the Community-JS Groups Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {CoursesSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCCourses-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCCourses-skeleton-root|Styles applied to the root element.| |courses|.SCCourses-skeleton-courses|Styles applied to the group elements.| * */ export default function CoursesSkeleton(inProps) { const { className, CourseSkeletonProps = {}, coursesNumber = 8, GridContainerComponentProps = {}, GridItemComponentProps = {}, teacherView = false } = inProps, rest = __rest(inProps, ["className", "CourseSkeletonProps", "coursesNumber", "GridContainerComponentProps", "GridItemComponentProps", "teacherView"]); return (_jsx(Root, Object.assign({ className: classNames(classes.root, className) }, rest, { children: _jsx(Grid, Object.assign({ container: true, spacing: { xs: 3 }, className: classes.courses }, GridContainerComponentProps, { children: [...Array(coursesNumber)].map((course, index) => (_jsx(Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 3 }, GridItemComponentProps, { className: classes.item }, { children: teacherView ? _jsx(CourseCreatePlaceholder, {}) : _jsx(CourseSkeleton, Object.assign({}, CourseSkeletonProps)) }), index))) })) }))); }