diff --git a/frontend/src/components/dashboard/DashboardSystemCard.tsx b/frontend/src/components/dashboard/DashboardSystemCard.tsx index 1a6dfd4..5cb5d96 100644 --- a/frontend/src/components/dashboard/DashboardSystemCard.tsx +++ b/frontend/src/components/dashboard/DashboardSystemCard.tsx @@ -1,13 +1,15 @@ import React from 'react'; interface Props { - label: string; - pct: number; // 0–100 - usedLabel: string; // e.g. "5.8GB" - totalLabel: string; // e.g. "7.8GB" + label: string; + pct: number; // 0–100 + usedLabel: string; + totalLabel: string; } -const BLOCKS = 12; +const BLOCKS = 10; // 10단계 (0%~100%, 10%씩) +// 눈금 레이블: top→bottom (100%→0%) +const TICK_LABELS = ['100%', '80%', '60%', '40%', '20%', '0%']; function trafficLevel(pct: number): 'green' | 'yellow' | 'red' { if (pct >= 90) return 'red'; @@ -15,9 +17,17 @@ function trafficLevel(pct: number): 'green' | 'yellow' | 'red' { return 'green'; } -/** 리소스 카드 — 세로 블록 바 + 신호등 */ +/** 블록 인덱스(0=bottom)에 따른 색상 — 낮은 사용률=초록, 높은 사용률=빨강 */ +function blockTone(idx: number): string { + if (idx >= 8) return 'gc-sys-block--hi'; // 80–100% → 빨강 + if (idx >= 5) return 'gc-sys-block--mid'; // 50–80% → 노랑 + return 'gc-sys-block--lo'; // 0–50% → 초록 +} + +/** 리소스 카드 — 눈금 + 세로 블록 바 + 신호등 (같은 높이 정렬) */ export default function DashboardSystemCard({ label, pct, usedLabel, totalLabel }: Props) { const clamped = Math.max(0, Math.min(100, pct)); + // 아래→위로 채움: filled 개수만큼 하단부터 켜짐 const filled = Math.round((clamped / 100) * BLOCKS); const level = trafficLevel(clamped); @@ -25,15 +35,23 @@ export default function DashboardSystemCard({ label, pct, usedLabel, totalLabel