@selfcommunity/react-ui
Version: 
React UI Components to integrate a Community created with SelfCommunity Platform.
17 lines (16 loc) • 985 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Stack, Typography } from '@mui/material';
import { FormattedMessage } from 'react-intl';
import { PREFIX } from '../constants';
import CourseParticipantsButton from '../../CourseParticipantsButton';
import { memo } from 'react';
import { InfoPositionType } from '../types';
const classes = {
    info: `${PREFIX}-info`
};
function InfoCourseDashboard(props) {
    // PROPS
    const { title, course, position } = props;
    return (_jsxs(Stack, Object.assign({ className: classes.info }, { children: [_jsx(Typography, Object.assign({ variant: "h4" }, { children: _jsx(FormattedMessage, { id: title, defaultMessage: title }) })), position === InfoPositionType.FIRST && _jsx(CourseParticipantsButton, { course: course }), position === InfoPositionType.SECOND && _jsxs(Typography, Object.assign({ variant: "h5" }, { children: [course.avg_completion_rate, "%"] }))] })));
}
export default memo(InfoCourseDashboard);