import { JSX, ParentComponent } from 'solid-js' import { twMerge } from 'tailwind-merge' type Props = { title: JSX.Element content: JSX.Element isOpen: boolean | undefined onCollapse: (collapsed: boolean) => void } const Collapse: ParentComponent = (props) => { const { title, content, onCollapse } = props const getCollapseClassName = () => { return props.isOpen ? 'collapse-open' : 'collapse-close' } const getCollapseContentClassName = () => { return props.isOpen ? 'opacity-100' : 'opacity-0 scale-y-0' } return (
onCollapse(!props.isOpen)} > {title}
{content}
) } export default Collapse