import React, { useRef, useState } from 'react'; import ChevronDown from '../assets/chevron-down.svg'; type AccordionProps = { title: string; children: React.ReactNode; className?: string; titleClassName?: string; contentClassName?: string; open?: boolean; }; export default function Accordion({ title, children, className = '', titleClassName = '', contentClassName = '', open: initialOpen = false, }: AccordionProps) { const contentRef = useRef(null); const [isOpen, setIsOpen] = useState(initialOpen); const accordionContentStyle = { height: isOpen ? 'auto' : '0px', transition: 'height 0.3s ease-in-out, opacity 0.3s ease-in-out', overflow: 'hidden', } as React.CSSProperties; const toggleAccordion = () => { setIsOpen(!isOpen); }; return (
{children}
); }