Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

578 B
Raw Blame
import type { Component } from 'solid-js';
import { type AnimatedNumberStateProps, useAnimatedNumberState } from './useAnimatedNumberState';

export interface AnimatedNumberProps extends AnimatedNumberStateProps {
  class?: string;
}

export const AnimatedNumber: Component<AnimatedNumberProps> = (props) => {
  const state = useAnimatedNumberState(props);

  return (
    <span
      class={`animated-number tabular-nums ${props.class ?? ''}`.trim()}
      data-animated-number="true"
      aria-label={state.targetText()}
    >
      {state.displayText()}
    </span>
  );
};