import React, { FC, useState } from "react"; import { Button, Card } from "../../../components"; import { QuestionCardField } from "./QuestionCardField"; interface Props { title: string onAddQuestion: Function, onRemoveQuestion: Function } export const QuestionCard: FC = ({ title, onAddQuestion, onRemoveQuestion }) => { const [collapsed, setCollapsed] = useState(false) const questionId = title.replace(/\s+/g, '') const handleAddQuestion = () => { setButtonState({ bg: 'bg-red-700', label: 'Remover', method: handleRemoveQuestion }) onAddQuestion(title, handleRemoveQuestion) } const handleRemoveQuestion = () => { setButtonState({ bg: '', label: 'Adicionar', method: handleAddQuestion }) onRemoveQuestion(questionId) } const [buttonState, setButtonState] = useState({ bg: '', label: 'Adicionar', method: handleAddQuestion }) return (
{!collapsed &&
Enunciado:
ijodsjidsoifidfsiojsdfiojdsfiodfs ijdf iodsf iosd iojdf sijodsf iojdsf ioj sdfiojdf sioj dfsiojsdf iojdfs ijodsfijoidfsijodfsijdfsijo dsiofd ijosdfjiofdsidsfio
}

) }