QueryInsightsHealthMetric.tsx 762 B

12345678910111213141516171819202122232425262728293031
  1. import { cn } from 'ui'
  2. interface QueryInsightsHealthMetricProps {
  3. label: string
  4. value: number | string | undefined
  5. className?: string
  6. isLoading?: boolean
  7. }
  8. export const QueryInsightsHealthMetric = ({
  9. label,
  10. value,
  11. className,
  12. isLoading,
  13. }: QueryInsightsHealthMetricProps) => {
  14. return (
  15. <div
  16. className={cn(
  17. 'font-mono text-xs flex items-center justify-between px-4 py-2 h-10',
  18. className
  19. )}
  20. >
  21. <span className="text-foreground-lighter tracking-wider truncate uppercase">{label}</span>
  22. {isLoading ? (
  23. <div className="h-3 w-12 rounded-sm bg-surface-300 animate-pulse" />
  24. ) : (
  25. <span className="text-foreground font-medium tabular-nums">{value}</span>
  26. )}
  27. </div>
  28. )
  29. }