import lightTheme from "@/utils/themes/light"; import { Button, ThemeProvider } from "@mui/material"; import { useState } from "react"; import { createPortal } from "react-dom"; import QuizDialog from "../QuizDialog"; interface Props { selector?: string; fixedSide?: "left" | "right"; quizId: string; } export default function OpenQuizButton({ selector, quizId, fixedSide }: Props) { const [isQuizDialogOpen, setIsQuizDialogOpen] = useState(false); const portalContainer = !fixedSide && selector ? document.querySelector(selector)! : document.body; return createPortal( setIsQuizDialogOpen(false)} /> , portalContainer ); }