import clsx from 'clsx'; import { PropsWithChildren } from 'react'; import { Cpu, Gpu, Hexagon, LaptopMinimal, MemoryStick } from 'lucide-react'; import { Icon, IconProps } from '@/react/components/Icon'; interface Props extends IconProps { title?: string; icon: IconProps['icon']; iconClass?: string; } export function StatsItem({ title, icon, children, iconClass, }: PropsWithChildren) { return (
{title}
{children}
); } interface StatsProps { value: string | number | undefined; } export function NodeStats({ value }: StatsProps) { return ( {value} ); } export function CPUStats({ value }: StatsProps) { return ( {value} cores ); } export function MemoryStats({ value }: StatsProps) { return ( {value} ); } export function GpuStats({ value }: StatsProps) { return ( {value} ); } interface ContainerStatsProps { total: number; running: number; stopped: number; } export function ContainerStats({ total, running, stopped, }: ContainerStatsProps) { const actualTotal = total || running + stopped; return (
{running} / {actualTotal}
); }