Skip to content

Commit f1fc755

Browse files
committed
refactor isr column
1 parent 0cd7488 commit f1fc755

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

frontend/src/components/Brokers/BrokersList/TableCells/TableCells.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ type InSyncReplicasProps = CellContext<
7878
BrokersTableRow['inSyncReplicas']
7979
>;
8080

81-
export const InSyncReplicas = ({ getValue }: InSyncReplicasProps) => {
82-
return <ColoredCell value={getValue() || ''} />;
81+
export const InSyncReplicas = ({ getValue, row }: InSyncReplicasProps) => {
82+
const inSyncReplicas = getValue();
83+
const { replicas } = row.original;
84+
if (inSyncReplicas === undefined || replicas === undefined) {
85+
return null;
86+
}
87+
return (
88+
<ColoredCell value={inSyncReplicas} attention={inSyncReplicas < replicas} />
89+
);
8390
};
8491

8592
type ReplicasProps = CellContext<BrokersTableRow, BrokersTableRow['replicas']>;

0 commit comments

Comments
 (0)