import { JSX, ParentComponent } from 'solid-js' import { twMerge } from 'tailwind-merge' // import { Ch} from '@tabler/icons-solidjs' 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 = () => { const openedClassName = 'collapse-open' const closedClassName = 'collapse-close' return props.isOpen ? openedClassName : closedClassName } const getCollapseContentClassName = () => { const openedClassName = 'opacity-100' const closedClassName = 'opacity-0' return props.isOpen ? openedClassName : closedClassName } return (
onCollapse(!props.isOpen)} > {title}
{content}
) } export default Collapse