import './Survey.css' import * as React from "react"; import {SurveyDto} from "./../../api/Api"; import {Box, Button, Paper, Step, StepContent, StepLabel, Stepper, Typography} from "@mui/material"; interface Props { survey: SurveyDto | undefined } const Survey: React.FC = ({survey}) => { const [activeStep, setActiveStep] = React.useState(-1); const handleNext = (group: string | undefined, value: number | undefined) => { setActiveStep((prevActiveStep) => prevActiveStep + 1); }; const handleBack = () => { setActiveStep((prevActiveStep) => prevActiveStep - 1); }; const handleReset = () => { setActiveStep(-1); }; const prepare = (text: string | undefined) => { if (text !== undefined) { return text .replaceAll("\n", "
") .replaceAll("

{survey?.title}



{survey?.questions.map((question, index) => Last step ) : null }> {'Question ' + (index + 1)}

{question.title}

{question.question}
{question.options.map((option, index) =>

)}
)}
{activeStep === survey?.questions.length && ( All steps completed - you're finished )}
) } export default Survey;