UNPKG

@selfcommunity/react-ui

Version:

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

20 lines (19 loc) 1.3 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const material_1 = require("@mui/material"); const react_intl_1 = require("react-intl"); const constants_1 = require("../constants"); const CourseParticipantsButton_1 = tslib_1.__importDefault(require("../../CourseParticipantsButton")); const react_1 = require("react"); const types_1 = require("../types"); const classes = { info: `${constants_1.PREFIX}-info` }; function InfoCourseDashboard(props) { // PROPS const { title, course, position } = props; return ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ className: classes.info }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "h4" }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: title, defaultMessage: title }) })), position === types_1.InfoPositionType.FIRST && (0, jsx_runtime_1.jsx)(CourseParticipantsButton_1.default, { course: course }), position === types_1.InfoPositionType.SECOND && (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ variant: "h5" }, { children: [course.avg_completion_rate, "%"] }))] }))); } exports.default = (0, react_1.memo)(InfoCourseDashboard);