Spaces:
Running on CPU Upgrade
Running on CPU Upgrade
Download web_app/src/components/matrix/Kpi.tsx from CommunityOne/open-navigator: direct link, hf CLI and curl.
- Browser
- Download file 774 Bytes
-
https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/components/matrix/Kpi.tsx
- Command line
-
hf download hf://spaces/CommunityOne/open-navigator/web_app/src/components/matrix/Kpi.tsx
-
curl -L -o Kpi.tsx https://huggingface.co/spaces/CommunityOne/open-navigator/resolve/main/web_app/src/components/matrix/Kpi.tsx
774 Bytes
| import { useCountUp } from '../../hooks/useCountUp' | |
| /** One big numeral with a mono label. The number counts up to the real value; a missing value stays "—". */ | |
| export default function Kpi({ | |
| label, | |
| value, | |
| format, | |
| sub, | |
| reduced, | |
| }: { | |
| label: string | |
| value: number | null | |
| format: (v: number) => string | |
| sub: string | |
| reduced: boolean | |
| }) { | |
| const text = useCountUp(value, format, reduced) | |
| return ( | |
| <div className="folio-kpi"> | |
| <dt className="folio-kpi-label">{label}</dt> | |
| <dd className="m-0"> | |
| <div className="folio-kpi-num" aria-label={value == null ? 'No data available' : format(value)}> | |
| <span aria-hidden="true">{text}</span> | |
| </div> | |
| <div className="folio-kpi-sub">{sub}</div> | |
| </dd> | |
| </div> | |
| ) | |
| } | |