import type { ReactNode } from "react"; import { cn } from "@/lib/utils"; /** Default cap (px) for a scrollable card body before it scrolls. */ const DEFAULT_SCROLL_MAX = 360; /** * Card shell for Host Metrics tiles. In the masonry grid tiles are * content-sized (auto height), so the card grows to fit its content. Scrollable * cards (long lists/logs) cap their body at `scrollMax` px and scroll beyond, * which keeps the masonry tidy while short cards stay compact. */ export function MetricCard({ title, icon, action, children, bodyClassName, scroll = false, scrollMax = DEFAULT_SCROLL_MAX, }: { title: string; icon: ReactNode; action?: ReactNode; children: ReactNode; bodyClassName?: string; /** When true the body caps its height and scrolls instead of growing. */ scroll?: boolean; /** Max body height in px for scrollable cards. */ scrollMax?: number; }) { return (