import { useQuizSettings } from "@/contexts/QuizDataContext"; import { AnyTypedQuizQuestion } from "@/model/questionTypes/shared"; import { Box, FormControl, MenuItem, Select as MuiSelect, useTheme } from "@mui/material"; import { useTranslation } from "react-i18next"; interface Props { selectedQuestion: AnyTypedQuizQuestion; setQuestion: (questionIdF: string) => void; } export default function QuestionSelect({ selectedQuestion, setQuestion }: Props) { const theme = useTheme(); const { questions, preview } = useQuizSettings(); const { t } = useTranslation(); if (!preview) return null; return ( { setQuestion(target.value); }} sx={{ height: "48px", borderRadius: "8px", "& .MuiOutlinedInput-notchedOutline": { border: `1px solid ${theme.palette.primary.main} !important`, }, "& .MuiSelect-icon": { color: theme.palette.primary.main, }, }} MenuProps={{ PaperProps: { sx: { mt: "8px", p: "4px", borderRadius: "8px", border: "1px solid #EEE4FC", boxShadow: "0px 8px 24px rgba(210, 208, 225, 0.4)", backgroundColor: theme.palette.background.default, }, }, MenuListProps: { sx: { py: 0, display: "flex", flexDirection: "column", gap: "8px", "& .Mui-selected": { backgroundColor: theme.palette.background.default, color: theme.palette.primary.main, }, }, }, }} inputProps={{ sx: { color: theme.palette.primary.main, display: "block", px: "9px", gap: "20px", width: "87%", overflow: "hidden", textOverflow: "ellipsis", }, }} > {questions .filter((q) => q.type !== "result") .map((question, index) => ( {`${index + 1}. ${question.title}`} ))} ); }