'use client'; import { useMemo } from 'react'; import { BarChart, Bar, XAxis, YAxis, ResponsiveContainer, Cell, Tooltip } from 'recharts'; import { useGraphStore } from '@/store/graph'; import { entityColor } from '@/lib/constants'; import { HubEntities } from './HubEntities'; export function GraphStats() { const data = useGraphStore((s) => s.data); const typeData = useMemo(() => { const counts: Record = {}; data.nodes.forEach((n) => (counts[n.type] = (counts[n.type] || 0) + 1)); return Object.entries(counts).map(([type, count]) => ({ type, count })); }, [data.nodes]); return (

{data.nodes.length}

Nodes

{data.links.length}

Edges

By Type

{typeData.map((d) => ( ))}
); }