import React, { ReactNode } from 'react' import BannerPrimitive from '../primitive/banner_primitive' import { BannerProps, ConditionalDescription } from './banner' // ================================= // ====== Component ================ // ================================= interface BannerCollapsibleProps extends BannerProps { /** * Hidden by default and shown when the banner is expanded. */ children?: ReactNode } export function BannerCollapsible({ appearance, children, description, heading, iconName, showIcon = true, style, }: BannerCollapsibleProps) { const [expanded, setExpanded] = React.useState(false) const toggleCollapsible = () => { setExpanded(prev => !prev) } if (!description && !heading) return null return ( {showIcon && } {Boolean(heading) && {heading}} {expanded ? children : null} ) }