import React, { useState } from 'react'; import { FaChevronDown, FaChevronUp } from 'react-icons/fa'; const Section = ({ title, icon, children, defaultExpanded = true }) => { const [isExpanded, setIsExpanded] = useState(defaultExpanded); return (
setIsExpanded(!isExpanded)} >

{icon} {title}

{isExpanded ? : }
{isExpanded && children}
); }; export default Section;