import { ChevronUpIcon } from '@chakra-ui/icons'; import { Box, Collapse, Flex, Spacer, Switch } from '@chakra-ui/react'; import { PropsWithChildren, memo } from 'react'; export type IAIToggleCollapseProps = PropsWithChildren & { label: string; isOpen: boolean; onToggle: () => void; withSwitch?: boolean; }; const IAICollapse = (props: IAIToggleCollapseProps) => { const { label, isOpen, onToggle, children, withSwitch = false } = props; return ( {label} {withSwitch && } {!withSwitch && ( )} {children} ); }; export default memo(IAICollapse);