import React from 'react' import dayjs from 'dayjs' import { Link as ConnectedLink } from 'react-router-dom' import { getNavigationsValue } from '@brojs/cli' import { Stack, Heading, Link, Button, Tooltip, Box, } from '@chakra-ui/react' import { useAppSelector } from '../../__data__/store' import { isTeacher } from '../../utils/user' import { PopulatedCourse } from '../../__data__/model' import { api } from '../../__data__/api/api' type CourseDetailsProps = { populatedCourse: PopulatedCourse; } export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => { const user = useAppSelector((s) => s.user) const exam = populatedCourse.examWithJury const [toggleExamWithJury, examWithJuryRequest] = api.useToggleExamWithJuryMutation() return ( <> Экзамен: {!Boolean(exam) && ( <> Не задан )} {Boolean(exam) && ( <> Количество членов жюри: {populatedCourse.examWithJury.jury.length} )} Список занятий: {populatedCourse?.lessons?.map((lesson) => ( {lesson.name} ))} ) }