28 lines
760 B
TypeScript
28 lines
760 B
TypeScript
import React from "react";
|
||
import type { GraphData } from "../types";
|
||
|
||
interface GraphStatsProps {
|
||
data: GraphData;
|
||
}
|
||
|
||
export const GraphStats: React.FC<GraphStatsProps> = ({ data }) => {
|
||
return (
|
||
<div
|
||
className="flex gap-4 text-xs"
|
||
style={{ color: "var(--text-secondary)" }}
|
||
>
|
||
<span>
|
||
Сервисы: {data.nodes.filter((n) => n.type === "service").length}
|
||
</span>
|
||
<span>Агенты: {data.nodes.filter((n) => n.type === "agent").length}</span>
|
||
<div className="flex items-center gap-1.5">
|
||
<div
|
||
className="w-2 h-2 rounded-sm"
|
||
style={{ backgroundColor: "var(--text-muted)" }}
|
||
></div>
|
||
<span>Связи: {data.links.length}</span>
|
||
</div>
|
||
</div>
|
||
);
|
||
};
|