import { Cell, Pie, PieChart, ResponsiveContainer, } from 'recharts'; import { Card } from '@/components/ui/Card'; type IpPoolChartProps = { used: number; total: number; }; export function IpPoolChart({ used, total, }: IpPoolChartProps) { const available = Math.max(total - used, 0); const percentage = total > 0 ? (used / total) * 100 : 0; const displayPercentage = percentage.toFixed(2); const data = [ { name: 'Usados', value: used, }, { name: 'Disponíveis', value: available, }, ]; return (

Uso da Pool IP

Capacidade de atribuição WireGuard

{data.map((_, index) => ( ))}

{displayPercentage}%

pool usada

Usados

{used}

Livres

{available}

Capacidade {used} / {total}
); }