Skip to content

Commit 29b6194

Browse files
committed
Memoize BMH and agent statuses
1 parent 1fa49b8 commit 29b6194

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

Diff for: libs/ui-lib/lib/cim/components/InfraEnv/InfraEnvAgentTable.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,14 @@ const InfraEnvAgentTable: React.FC<InfraEnvAgentTableProps> = ({
109109
},
110110
);
111111
const { t } = useTranslation();
112-
const agentStatuses = agentStatus(t);
113-
const bmhStatuses = bmhStatus(t);
112+
const { agentStatuses, bmhStatuses } = React.useMemo(
113+
() => ({
114+
agentStatuses: agentStatus(t),
115+
bmhStatuses: bmhStatus(t),
116+
}),
117+
[t],
118+
);
119+
114120
const {
115121
statusCount,
116122
hostnameFilter,

0 commit comments

Comments
 (0)