Spaces:
Running
Running
Download frontend/src/components/StatusCard.js from xenecode/Jaguar_Project: direct link, hf CLI and curl.
- Browser
- Download file 971 Bytes
-
https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/frontend/src/components/StatusCard.js
- Command line
-
hf download hf://spaces/xenecode/Jaguar_Project/frontend/src/components/StatusCard.js
-
curl -L -o StatusCard.js https://huggingface.co/spaces/xenecode/Jaguar_Project/resolve/main/frontend/src/components/StatusCard.js
971 Bytes
| import React from 'react'; | |
| const TONES = { | |
| neutral: 'text-hmi-text', | |
| ok: 'text-hmi-ok', | |
| err: 'text-hmi-err', | |
| warn: 'text-hmi-warn', | |
| accent: 'text-hmi-accent', | |
| }; | |
| const StatusCard = ({ title, value, isBoolean = false, tone, className = '' }) => { | |
| const displayValue = isBoolean ? (value ? 'Yes' : 'No') : (value ?? '—'); | |
| const resolvedTone = tone || (isBoolean ? (value ? 'ok' : 'err') : 'neutral'); | |
| return ( | |
| <div className={`border border-hmi-line bg-hmi-panel px-4 py-3 ${className}`}> | |
| <div className="text-[11px] font-medium uppercase tracking-[0.12em] text-hmi-muted">{title}</div> | |
| <div className={`mt-1.5 flex items-center gap-2 font-mono text-2xl font-semibold tabular-nums ${TONES[resolvedTone]}`}> | |
| {isBoolean && ( | |
| <span className={`h-2.5 w-2.5 shrink-0 ${value ? 'bg-hmi-ok' : 'bg-hmi-err'}`} aria-hidden="true" /> | |
| )} | |
| {displayValue} | |
| </div> | |
| </div> | |
| ); | |
| }; | |
| export default StatusCard; | |