import type { ReactNode } from 'react' import { Frame, FrameDescription, FrameFooter, FrameHeader, FramePanel, FrameTitle, } from '@/components/reui/frame' import { cn } from '@evobgp/ui/lib/utils' /** * Frame shell class constants (legacy Card names kept for DataGridShell / toolbar). * @see https://reui.io/docs/components/base/frame */ export const panelCardClassName = 'w-full gap-0 p-0' export const panelCardHeaderClassName = 'border-b' /** Flush body inside FramePanel (toolbar / data-grid). */ export const panelCardContentFlushClassName = 'p-0' /** Horizontal inset for toolbar / pagination rows. */ export const panelCardInsetClassName = 'px-5 py-3' export const panelCardFooterClassName = 'border-t bg-transparent' interface PanelCardProps { title?: ReactNode description?: ReactNode actions?: ReactNode footer?: ReactNode children?: ReactNode className?: string headerClassName?: string contentClassName?: string footerClassName?: string size?: 'default' | 'sm' } export function PanelCard({ title, description, actions, footer, children, className, headerClassName, contentClassName, footerClassName, size = 'default', }: PanelCardProps) { const hasHeader = Boolean(title || description || actions) const spacing = size === 'sm' ? 'sm' : 'default' return ( {hasHeader ? (
{title ? {title} : null} {description ? ( {description} ) : null}
{actions ? (
{actions}
) : null}
) : null} {children != null && children !== false ? (
{children}
) : null} {footer ? ( {footer} ) : null}
) }