Skip to content

Commit

Permalink
added component for faq
Browse files Browse the repository at this point in the history
Signed-off-by: Apurv Sonawane <[email protected]>
  • Loading branch information
Apurv428 committed Jul 3, 2024
1 parent 4f97d75 commit cd212dd
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions react-frontend/src/components/FaqAccordion/Accordion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import React, { useState } from 'react'

const Accordion = ({ que, ans }) => {
const [show, setShow] = useState(false)

return (
<>
<div className='main-heading'>
<p onClick={() => setShow(!show)}>{show ? '➖' : '➕'}</p>
<h3>{que}</h3>
</div>
{show && <div className='answers'>{ans}</div>}
</>
)
}

export default Accordion

0 comments on commit cd212dd

Please sign in to comment.