2024-02-14 11:03:35 +00:00
|
|
|
|
import { useQuizData } from "@contexts/QuizDataContext";
|
2024-02-08 13:42:31 +00:00
|
|
|
|
import { Box, Typography, useTheme } from "@mui/material";
|
|
|
|
|
import { ReactNode } from "react";
|
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();
|
|
|
|
|
const { questions } = useQuizData();
|
|
|
|
|
console.log(questions);
|
2024-01-30 16:49:33 +00:00
|
|
|
|
|
2024-02-29 14:07:09 +00:00
|
|
|
|
return (
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
position: "relative",
|
|
|
|
|
padding: "15px 0",
|
|
|
|
|
borderTop: `1px solid ${theme.palette.grey[400]}`,
|
|
|
|
|
height: "75px",
|
|
|
|
|
display: "flex",
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
<Box
|
|
|
|
|
sx={{
|
|
|
|
|
width: "100%",
|
|
|
|
|
maxWidth: "1000px",
|
|
|
|
|
padding: "0 10px",
|
|
|
|
|
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" }} />*/}
|
|
|
|
|
{/*)}*/}
|
|
|
|
|
{stepNumber !== null && (
|
|
|
|
|
<Box
|
2024-01-30 16:49:33 +00:00
|
|
|
|
sx={{
|
2024-02-29 14:07:09 +00:00
|
|
|
|
display: "flex",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
gap: "10px",
|
|
|
|
|
marginRight: "auto",
|
|
|
|
|
color: theme.palette.text.primary,
|
2024-01-30 16:49:33 +00:00
|
|
|
|
}}
|
2024-02-29 14:07:09 +00:00
|
|
|
|
>
|
|
|
|
|
<Typography>Шаг</Typography>
|
|
|
|
|
<Typography
|
|
|
|
|
sx={{
|
|
|
|
|
display: "flex",
|
|
|
|
|
justifyContent: "center",
|
|
|
|
|
alignItems: "center",
|
|
|
|
|
fontWeight: "bold",
|
|
|
|
|
borderRadius: "50%",
|
|
|
|
|
width: "30px",
|
|
|
|
|
height: "30px",
|
|
|
|
|
color: "#FFF",
|
|
|
|
|
background: theme.palette.primary.main,
|
|
|
|
|
}}
|
2024-01-30 16:49:33 +00:00
|
|
|
|
>
|
2024-02-29 14:07:09 +00:00
|
|
|
|
{stepNumber}
|
|
|
|
|
</Typography>
|
|
|
|
|
<Typography>Из</Typography>
|
|
|
|
|
<Typography sx={{ fontWeight: "bold" }}>
|
|
|
|
|
{questions.filter((q) => q.type !== "result").length}
|
|
|
|
|
</Typography>
|
|
|
|
|
</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
|
|
|
|
};
|