'use client' import { useState, useRef, useEffect } from 'react' type AccordionpProps = { children: React.ReactNode tag?: string title: string active?: boolean } export default function Accordion({ children, tag = 'li', title, active = false }: AccordionpProps) { const [accordionOpen, setAccordionOpen] = useState(false) const accordion = useRef(null) const Component = tag as keyof JSX.IntrinsicElements useEffect(() => { setAccordionOpen(active) }, [accordion]) return (

{children}

) }