import cn from 'classnames'; import { ReactNode } from 'react'; import { extractSupportProps, WithSupportProps } from '@snack-uikit/utils'; import { TEST_IDS } from '../../testIds'; import styles from './styles.module.scss'; export type CollapseBlockPrivateProps = WithSupportProps<{ children: ReactNode; header: ReactNode; expanded: boolean; expandedDebounced: boolean; removeContentFromDOM?: boolean; className?: string; shape?: 'round' | 'square'; }>; export function CollapseBlockPrivate({ children, expanded, className, header, shape, expandedDebounced, removeContentFromDOM = true, ...rest }: CollapseBlockPrivateProps) { return (
{header}
{(!removeContentFromDOM || expanded || expandedDebounced) && children}
); }