import { RefreshCw, HardDrive, FileText, Building2, Clock } from "lucide-react"; import { AllDiskUsageInfo } from "@/types/company"; import { Button } from "@/components/ui/button"; import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; interface DiskUsageSummaryProps { diskUsageInfo: AllDiskUsageInfo | null; isLoading: boolean; onRefresh: () => void; } /** * 디스크 사용량 요약 정보 컴포넌트 */ export function DiskUsageSummary({ diskUsageInfo, isLoading, onRefresh }: DiskUsageSummaryProps) { if (!diskUsageInfo) { return (
디스크 사용량 전체 회사 파일 저장 현황

디스크 사용량 정보를 불러오는 중...

); } const { summary, lastChecked } = diskUsageInfo; const lastCheckedDate = new Date(lastChecked); return (
디스크 사용량 현황 전체 회사 파일 저장 통계
{/* 총 회사 수 */}

총 회사

{summary.totalCompanies}개

{/* 총 파일 수 */}

총 파일

{summary.totalFiles.toLocaleString()}개

{/* 총 용량 */}

총 용량

{summary.totalSizeMB.toFixed(1)} MB

{/* 마지막 업데이트 */}

마지막 확인

{lastCheckedDate.toLocaleString("ko-KR", { month: "short", day: "numeric", hour: "2-digit", minute: "2-digit", })}

{/* 용량 기준 상태 표시 */}
저장소 상태 1000 ? "destructive" : summary.totalSizeMB > 500 ? "secondary" : "default"} > {summary.totalSizeMB > 1000 ? "용량 주의" : summary.totalSizeMB > 500 ? "보통" : "여유"}
{/* 간단한 진행 바 */}
1000 ? "bg-destructive/100" : summary.totalSizeMB > 500 ? "bg-yellow-500" : "bg-green-500" }`} style={{ width: `${Math.min((summary.totalSizeMB / 2000) * 100, 100)}%`, }} />
0 MB 2,000 MB (권장 최대)
); }