import React, { useCallback } from 'react' import { useCollapse, CollapsePanelProps, Collapse } from 'react-icecream' import { RightThinIcon } from 'react-icecream/icons' function GhostPanel(props: CollapsePanelProps) { const { title, value, children } = props const { value: activeValue, toggleActive } = useCollapse() const isExpanded = activeValue.indexOf(value) !== -1 const handleNameClick = useCallback(() => { toggleActive(value) }, [toggleActive, value]) return (
{title}
{isExpanded && (
{children}
)}
) } export default function Demo() { return ( ghost panel 1 ghost panel 2 ) }