import { useState } from 'react'

function Question(prop) {
  const [qflag, setqflag] = useState(false)
  return (
    <div className="questioncont">
      <div className="question" onClick={() => setqflag(!qflag)}>
        <p>{prop.que.question}</p>
        <div className="question_icon">
          {!qflag ? (
            <i className="fa-solid fa-plus"></i>
          ) : (
            <i className="fa-solid fa-minus"></i>
          )}
        </div>
      </div>
      {qflag ? (
        <div className="question_ans">
          {' '}
          <p>{prop.que.answer}</p>
        </div>
      ) : null}
    </div>
  )
}
export default Question
