2024-04-23 14:45:49 +00:00
|
|
|
import type { QuizQuestionDate } from "@model/questionTypes/date";
|
2024-10-08 14:27:17 +00:00
|
|
|
import DateRange from "./DateRange";
|
|
|
|
import DatePicker from "./DatePicker";
|
2024-06-29 09:32:16 +00:00
|
|
|
import { Box, Typography, useTheme } from "@mui/material";
|
2023-12-16 14:55:56 +00:00
|
|
|
|
|
|
|
type DateProps = {
|
2024-04-22 14:13:43 +00:00
|
|
|
currentQuestion: QuizQuestionDate;
|
2023-12-16 14:55:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export const Date = ({ currentQuestion }: DateProps) => {
|
2024-04-23 14:45:49 +00:00
|
|
|
const theme = useTheme();
|
2024-01-30 16:49:33 +00:00
|
|
|
|
2024-04-22 14:13:43 +00:00
|
|
|
return (
|
|
|
|
<Box>
|
2024-06-29 09:32:16 +00:00
|
|
|
<Typography
|
|
|
|
variant="h5"
|
|
|
|
color={theme.palette.text.primary}
|
|
|
|
sx={{ wordBreak: "break-word" }}
|
|
|
|
>
|
2024-04-22 14:13:43 +00:00
|
|
|
{currentQuestion.title}
|
|
|
|
</Typography>
|
2024-10-08 14:27:17 +00:00
|
|
|
{currentQuestion.content.isRange ? (
|
|
|
|
<DateRange currentQuestion={currentQuestion} />
|
|
|
|
) : (
|
|
|
|
<DatePicker currentQuestion={currentQuestion} />
|
|
|
|
)}
|
2024-04-22 14:13:43 +00:00
|
|
|
</Box>
|
|
|
|
);
|
2024-01-09 10:17:56 +00:00
|
|
|
};
|