Spaces:
Sleeping
Sleeping
Download frontend/src/components/StatsBar.js from Ilaa-1505/Error-Clustering-System: direct link, hf CLI and curl.
- Browser
- Download file 1.64 kB
-
https://huggingface.co/spaces/Ilaa-1505/Error-Clustering-System/resolve/main/frontend/src/components/StatsBar.js
- Command line
-
hf download hf://spaces/Ilaa-1505/Error-Clustering-System/frontend/src/components/StatsBar.js
-
curl -L -o StatsBar.js https://huggingface.co/spaces/Ilaa-1505/Error-Clustering-System/resolve/main/frontend/src/components/StatsBar.js
1.64 kB
| export default function StatsBar({ stats, nClusters, nAnomalies, silhouette }) { | |
| const items = [ | |
| { label: 'TOTAL LINES', value: stats.total_lines }, | |
| { label: 'VALID ERRORS', value: stats.valid }, | |
| { label: 'DUPLICATES', value: stats.duplicates }, | |
| { label: 'SKIPPED INFO', value: stats.skipped_info }, | |
| { label: 'CLUSTERS', value: nClusters }, | |
| { label: 'ANOMALIES', value: nAnomalies }, | |
| { label: 'SILHOUETTE', value: silhouette.toFixed(3) }, | |
| ]; | |
| const formats = Object.entries(stats.formats_detected || {}); | |
| return ( | |
| <div className="stats-section fade-in"> | |
| <div className="stats-bar"> | |
| {items.map(item => ( | |
| <div key={item.label} className="stat-item"> | |
| <div className="stat-value">{item.value}</div> | |
| <div className="stat-label">{item.label}</div> | |
| </div> | |
| ))} | |
| </div> | |
| {formats.length > 0 && ( | |
| <div className="formats-bar"> | |
| <span className="formats-label">DETECTED FORMATS</span> | |
| <div className="formats-list"> | |
| {formats.map(([fmt, count]) => ( | |
| <div key={fmt} className="format-badge"> | |
| <span className="format-name">{fmt.toUpperCase()}</span> | |
| <span className="format-count">{count}</span> | |
| </div> | |
| ))} | |
| </div> | |
| </div> | |
| )} | |
| </div> | |
| ); | |
| } |