import { Box } from "@mui/material";
import ContextProviders from "./ContextProviders";
import { QuizIdContext } from "./contexts/QuizIdContext";
import { useParams } from "react-router-dom";
import { ViewPage } from "./pages/ViewPublicationPage/ViewPublicationPage";


const defaultQuizId = "ef836ff8-35b1-4031-9acf-af5766bac2b2";

export default function App() {
    const quizId = useParams().quizId ?? defaultQuizId;

    return (
        <QuizIdContext.Provider value={quizId}>
            <ContextProviders>
                <Box sx={{
                    height: "100dvh",
                }}>
                    <ViewPage />
                </Box>
            </ContextProviders>
        </QuizIdContext.Provider>
    );
}
