Skip to content

Commit 83fa5ca

Browse files
committed
Memoize BMH and agent statuses
1 parent 949f58d commit 83fa5ca

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
@@ -108,8 +108,14 @@ const InfraEnvAgentTable: React.FC<InfraEnvAgentTableProps> = ({
108108
},
109109
);
110110
const { t } = useTranslation();
111-
const agentStatuses = agentStatus(t);
112-
const bmhStatuses = bmhStatus(t);
111+
const { agentStatuses, bmhStatuses } = React.useMemo(
112+
() => ({
113+
agentStatuses: agentStatus(t),
114+
bmhStatuses: bmhStatus(t),
115+
}),
116+
[t],
117+
);
118+
113119
const {
114120
statusCount,
115121
hostnameFilter,

0 commit comments

Comments
 (0)