import { ExternalLink, Maximize2, Minimize2 } from 'lucide-react' import Link from 'next/link' import { forwardRef, ReactNode, useState } from 'react' import { Button } from 'ui' interface InformationBoxProps { icon?: ReactNode title: ReactNode | string description?: ReactNode | string url?: string urlLabel?: string defaultVisibility?: boolean hideCollapse?: boolean button?: React.ReactNode className?: string block?: boolean } /** @deprecated Use `Admonition` from 'ui-patterns' instead. */ const InformationBox = forwardRef( ( { icon, title, description, url, urlLabel = 'Read more', defaultVisibility = false, hideCollapse = false, button, className = '', block = false, }, ref ) => { const [isExpanded, setIsExpanded] = useState(defaultVisibility) return (
{icon && {icon}}
{title}
{description && !hideCollapse ? (
setIsExpanded(!isExpanded)} > {isExpanded ? ( ) : ( )}
) : null}
{(description || url || button) && (
{description}
{url && (
)} {button &&
{button}
}
)}
) } ) InformationBox.displayName = 'InformationBox' export default InformationBox