import React, { useState } from "react";
import { useNavigate } from "react-router-dom";
import { BasicQuestionType, AnswerType, SurveyType } from "../types";
import { ACheckboxForm } from "./ACheckbox";
import { ADropdownForm } from "./ADropdown";
import { AEssayForm } from "./AEssayForm";
import { ARadioForm } from "./ARadioForm";
type Props = {
question: BasicQuestionType;
response: AnswerType;
handleAnswer: () => void;
};
export const AQuestion = ({ question, handleAnswer, response }: Props) => {
function getContent(question: BasicQuestionType) {
switch (question.type) {
case "essay":
return (