import { Megaphone } from 'lucide-react' import { forwardRef, type PropsWithChildren, type ReactNode } from 'react' import { Badge, Button, cn, Loading } from 'ui' interface PanelProps { className?: string id?: string footer?: ReactNode loading?: boolean noMargin?: boolean title?: ReactNode | false wrapWithLoading?: boolean noHideOverflow?: boolean titleClasses?: string footerClasses?: string } /** * @deprecated Use Card component from ui package instead */ function Panel(props: PropsWithChildren) { const content = (
{props.title && (
{props.title}
)} {props.children} {props.footer &&
{props.footer}
}
) if (props.wrapWithLoading === false) { return content } return {content} } function Content({ children, className }: { children: ReactNode; className?: string | false }) { return
{children}
} function Footer({ children, className }: { children: ReactNode; className?: string }) { return (
{children}
) } const PanelNotice = forwardRef< HTMLDivElement, { className?: string | false title?: string description?: ReactNode href?: string buttonText?: string layout?: 'horizontal' | 'vertical' badgeLabel?: string } >( ( { className, title, description, href, buttonText, layout = 'horizontal', badgeLabel, ...props }, ref ) => { return (
{badgeLabel ?? 'Upcoming change'} {title}
{description && (
{description}
)}
{href && ( )}
) } ) PanelNotice.displayName = 'PanelNotice' Panel.Content = Content Panel.Footer = Footer Panel.Notice = PanelNotice export default Panel