JavaScript 56.7%
TypeScript 42.6%
1"use client";23import { useMemo } from "react";4import StorageDonut from "@/components/dashboard/StorageDonut";5import { aggregateByCategory, type CategoryStat } from "@/components/dashboard/categories";6import { STORAGE_QUOTA_BYTES } from "@/lib/prefs";78interface TypeBreakdown {9 type: string;10 count: number;11 size: number;12}1314interface StorageChartProps {15 data: TypeBreakdown[];16 totalSize: number;17 /** Si fourni par l'API (v3), utilisé tel quel ; sinon agrégé côté client. */18 byCategory?: CategoryStat[];19}2021/** Répartition du stockage par catégorie — même donut que l'accueil. */22export default function StorageChart({ data, totalSize, byCategory }: StorageChartProps) {23 const cats = useMemo(() => byCategory && byCategory.length ? byCategory : aggregateByCategory(data), [byCategory, data]);24 return <StorageDonut data={cats} totalUsed={totalSize} quota={STORAGE_QUOTA_BYTES} size={184} legend="side" />;25}26