feat(page): Optimize data handling with useMemo for boards, agents, and gateways

This commit is contained in:
Abhimanyu Saharan
2026-02-05 00:11:48 +05:30
parent 1889ac997e
commit 8f224910b5
6 changed files with 7 additions and 14 deletions

View File

@@ -120,8 +120,8 @@ export default function AgentsPage() {
refetchOnMount: "always",
});
const boards = boardsQuery.data ?? [];
const agents = agentsQuery.data ?? [];
const boards = useMemo(() => boardsQuery.data ?? [], [boardsQuery.data]);
const agents = useMemo(() => agentsQuery.data ?? [], [agentsQuery.data]);
useEffect(() => {
if (!boardId && boards.length > 0) {
@@ -285,6 +285,7 @@ export default function AgentsPage() {
[boards]
);
// eslint-disable-next-line react-hooks/incompatible-library
const table = useReactTable({
data: sortedAgents,
columns,