frontPanel/src/pages/createQuize/FirstQuiz.tsx

46 lines
1.1 KiB
TypeScript
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {Button, Typography, useTheme} from "@mui/material";
import ComplexNavText from "./ComplexNavText";
import SectionWrapper from "@ui_kit/SectionWrapper";
import {quizStore} from "@root/quizes";
import {Link, useNavigate} from "react-router-dom";
function getRandom(min: number, max:number) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min)) + min;
}
export default function FirstQuiz() {
const {listQuizes, updateQuizesList, removeQuiz, createBlank} = quizStore()
const navigate = useNavigate()
return (
<SectionWrapper
maxWidth="lg"
sx={{
mt: "25px",
mb: "70px",
}}
>
<ComplexNavText text1="Кабинет квизов" />
<Typography
variant="h4"
sx={{
mt: "20px",
mb: "30px",
}}
>
Создайте свой первый квиз
</Typography>
<Button
variant="contained"
onClick={() => {
navigate(`/quize-setting/${createBlank()}`);
}}
>
Создать +
</Button>
</SectionWrapper>
);
}