frontAnswerer/lib/components/ViewPublicationPage/questions/Date/index.tsx

30 lines
750 B
TypeScript
Raw Normal View History

2024-04-23 14:45:49 +00:00
import type { QuizQuestionDate } from "@model/questionTypes/date";
import DateRange from "./DateRange";
import DatePicker from "./DatePicker";
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-04-22 14:13:43 +00:00
return (
<Box>
<Typography
variant="h5"
color={theme.palette.text.primary}
sx={{ wordBreak: "break-word" }}
>
2024-04-22 14:13:43 +00:00
{currentQuestion.title}
</Typography>
{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
};