link 2 exam

This commit is contained in:
Primakov Alexandr Alexandrovich
2024-08-29 09:55:05 +03:00
parent a8195cd627
commit 5911cdf8a8
6 changed files with 137 additions and 21 deletions

View File

@@ -15,6 +15,7 @@ import { useAppSelector } from '../../__data__/store'
import { isTeacher } from '../../utils/user'
import { PopulatedCourse } from '../../__data__/model'
import { api } from '../../__data__/api/api'
import { LinkIcon } from '@chakra-ui/icons'
type CourseDetailsProps = {
populatedCourse: PopulatedCourse;
@@ -28,7 +29,16 @@ export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
return (
<>
<Heading as="h3" mt={4} mb={3} size="lg">
Экзамен:
Экзамен: {exam?.name} {exam && <Tooltip label="Начать экзамен" fontSize="12px" top="16px">
<Button
leftIcon={<LinkIcon />}
as={'a'}
colorScheme="blue"
href={`/exam/${populatedCourse.id}/${exam.id}`}
>
Открыть
</Button>
</Tooltip>}
</Heading>
{!Boolean(exam) && (
<>
@@ -36,7 +46,7 @@ export const CourseDetails = ({ populatedCourse }: CourseDetailsProps) => {
Не задан
</Heading>
<Box mt={10}>
<Tooltip label="Детали" fontSize="12px" top="16px">
<Tooltip label="Создать экзамен с жюри" fontSize="12px" top="16px">
<Button
colorScheme="blue"
mt={["16px", 0]}