2024-02-08 13:42:31 +00:00
|
|
|
|
import { ReactNode } from "react";
|
2024-03-04 16:40:53 +00:00
|
|
|
|
import { Box, Typography, useTheme } from "@mui/material";
|
|
|
|
|
|
|
|
|
|
import { useQuizData } from "@contexts/QuizDataContext";
|
|
|
|
|
|
|
|
|
|
import Stepper from "@ui_kit/Stepper";
|
2023-12-16 14:55:56 +00:00
|
|
|
|
|
|
|
|
|
type FooterProps = {
|
2024-02-29 14:07:09 +00:00
|
|
|
|
stepNumber: number | null;
|
|
|
|
|
nextButton: ReactNode;
|
|
|
|
|
prevButton: ReactNode;
|
2023-12-16 14:55:56 +00:00
|
|
|
|
};
|
|
|
|
|
|
2024-02-08 13:42:31 +00:00
|
|
|
|
export const Footer = ({ stepNumber, nextButton, prevButton }: FooterProps) => {
|
2024-02-29 14:07:09 +00:00
|
|
|
|
const theme = useTheme();
|
2024-03-04 16:40:53 +00:00
|
|
|
|
const { questions, settings } = useQuizData();
|
|
|
|
|
const questionsAmount = questions.filter(
|
|
|
|
|
({ type }) => type !== "result"
|
|
|
|
|
).length;
|
2024-04-05 10:43:28 +00:00
|
|
|
|
if (stepNumber === null) stepNumber = -1
|
|
|
|
|
console.log("stepNumber ", stepNumber)
|
2024-02-29 14:07:09 +00:00
|
|
|
|
return (
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
position: "relative",
|
|
|
|
|
padding: "15px 0",
|
2024-03-26 00:06:54 +00:00
|
|
|
|
borderTop: `1px solid #9A9AAF80`,
|
2024-02-29 14:07:09 +00:00
|
|
|
|
height: "75px",
|
|
|
|
|
display: "flex",
|
2024-03-04 16:40:53 +00:00
|
|
|
|
background: settings.cfg.design
|
|
|
|
|
? "rgba(154,154,175, 0.2)"
|
|
|
|
|
: "transparent",
|
2024-02-29 14:07:09 +00:00
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: "100%",
|
2024-03-04 16:40:53 +00:00
|
|
|
|
maxWidth: "1410px",
|
|
|
|
|
padding: "10px",
|
2024-02-29 14:07:09 +00:00
|
|
|
|
margin: "0 auto",
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{/*{mode[settings.cfg.theme] ? (*/}
|
|
|
|
|
{/* <NameplateLogoFQ style={{ fontSize: "34px", width:"200px", height:"auto" }} />*/}
|
|
|
|
|
{/*):(*/}
|
|
|
|
|
{/* <NameplateLogoFQDark style={{ fontSize: "34px", width:"200px", height:"auto" }} />*/}
|
|
|
|
|
{/*)}*/}
|
2024-03-04 16:40:53 +00:00
|
|
|
|
<Box sx={{ flexGrow: 1 }}>
|
|
|
|
|
<Typography sx={{ color: theme.palette.text.primary }}>
|
|
|
|
|
Вопрос {stepNumber} из {questionsAmount}
|
2024-02-29 14:07:09 +00:00
|
|
|
|
</Typography>
|
2024-03-04 16:40:53 +00:00
|
|
|
|
<Stepper activeStep={stepNumber} steps={questionsAmount} />
|
2024-02-29 14:07:09 +00:00
|
|
|
|
</Box>
|
2024-01-30 16:49:33 +00:00
|
|
|
|
|
2024-02-29 14:07:09 +00:00
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
marginRight: "auto",
|
|
|
|
|
// color: theme.palette.grey1.main,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{/* <Typography>Шаг</Typography>
|
2023-12-29 00:58:19 +00:00
|
|
|
|
<Typography
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
justifyContent: "center",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
fontWeight: "bold",
|
|
|
|
|
borderRadius: "50%",
|
|
|
|
|
width: "30px",
|
|
|
|
|
height: "30px",
|
|
|
|
|
color: "#FFF",
|
|
|
|
|
background: theme.palette.brightPurple.main,
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{stepNumber} */}
|
2024-02-29 14:07:09 +00:00
|
|
|
|
{/* </Typography> */}
|
|
|
|
|
{/* <Typography>Из</Typography>
|
2023-12-29 00:58:19 +00:00
|
|
|
|
<Typography sx={{ fontWeight: "bold" }}>
|
|
|
|
|
{questions.length}
|
|
|
|
|
</Typography> */}
|
2023-12-16 14:55:56 +00:00
|
|
|
|
</Box>
|
2024-02-29 14:07:09 +00:00
|
|
|
|
{prevButton}
|
|
|
|
|
{nextButton}
|
|
|
|
|
</Box>
|
|
|
|
|
</Box>
|
|
|
|
|
);
|
2023-12-16 14:55:56 +00:00
|
|
|
|
};
|