parent
6165264f15
commit
6df562137d
2 changed files with 36 additions and 0 deletions
@ -0,0 +1,25 @@ |
||||
import React, { useState } from "react"; |
||||
|
||||
import QandA from "./QandA"; |
||||
|
||||
function QuestionAnswer() { |
||||
const list = { |
||||
1: <QandA />, |
||||
}; |
||||
const [type, setType] = useState(1); |
||||
return ( |
||||
<div className="w-full flex flex-col items-center"> |
||||
<select |
||||
className="mb-10 w-20 bg-gray-200" |
||||
onChange={(e) => setType(e.target.value)} |
||||
> |
||||
{Object.keys(list).map((option, index) => ( |
||||
<option key={index}>{option}</option> |
||||
))} |
||||
</select> |
||||
{list[type]} |
||||
</div> |
||||
); |
||||
} |
||||
|
||||
export default QuestionAnswer; |
Loading…
Reference in new issue