Openstatus www.openstatus.dev
at main 20 lines 514 B view raw
1import { cn } from "@/lib/utils"; 2 3export function TableCellNumber({ 4 value, 5 className, 6 unit, 7 ...props 8}: React.ComponentProps<"div"> & { value: unknown; unit?: string }) { 9 const _value = Number(value); 10 if (Number.isNaN(_value)) { 11 return <div className="font-mono text-muted-foreground">N/A</div>; 12 } 13 14 return ( 15 <div className={cn("font-mono text-foreground", className)} {...props}> 16 {_value} 17 {unit && <span className="p-0.5 text-muted-foreground">{unit}</span>} 18 </div> 19 ); 20}