fix communication between question and selecte question cards

This commit is contained in:
WindowsCrashed
2023-08-08 14:23:39 -03:00
parent c26ae6194f
commit ebb7966cd1
4 changed files with 15 additions and 13 deletions

View File

@@ -1,13 +1,14 @@
import React, { FC, PropsWithChildren } from "react";
import React, { FC, } from "react";
import { SideBar } from "./SideBar";
import { SelectedQuestionCard } from "./SelectedQuestionCard";
type Props = {
questions: {id: string, label: string}[],
onRemoveQuestion: Function
questions: {
id: string, label: string, removeHandler: Function
}[]
}
export const SelectedQuestionsSideBar: FC<Props> = ({ questions, onRemoveQuestion }) => {
export const SelectedQuestionsSideBar: FC<Props> = ({ questions }) => {
return (
<SideBar>
<h1>Questões Selecionadas</h1>
@@ -16,7 +17,7 @@ export const SelectedQuestionsSideBar: FC<Props> = ({ questions, onRemoveQuestio
{questions.length ?
questions.map(q => <SelectedQuestionCard
key={q.id} id={q.id} label={q.label}
onRemoveQuestion={onRemoveQuestion}/>) :
onRemoveQuestion={q.removeHandler}/>) :
<h2 className="text-gray-700 mt-3">
Nenhuma questão selecionada
</h2>