diff --git a/frontend/src/components/Topics/List/TopicTable.tsx b/frontend/src/components/Topics/List/TopicTable.tsx index 5bd5b565c..6e851706f 100644 --- a/frontend/src/components/Topics/List/TopicTable.tsx +++ b/frontend/src/components/Topics/List/TopicTable.tsx @@ -72,19 +72,13 @@ const TopicTable: React.FC = () => { size: 148, }, { + id: TopicColumnsToSort.MESSAGES_COUNT, header: 'Number of messages', - accessorKey: 'partitions', - enableSorting: false, - size: 146, - cell: ({ getValue }) => { - const partitions = getValue(); - if (partitions === undefined || partitions.length === 0) { - return 0; - } - return partitions.reduce((memo, { offsetMax, offsetMin }) => { - return memo + (offsetMax - offsetMin); - }, 0); + accessorKey: 'messagesCount', + cell: (args) => { + return args.getValue() ?? 'N/A'; }, + size: 146, }, { id: TopicColumnsToSort.SIZE, diff --git a/frontend/src/lib/fixtures/topics.ts b/frontend/src/lib/fixtures/topics.ts index ec8803c4b..eab718cde 100644 --- a/frontend/src/lib/fixtures/topics.ts +++ b/frontend/src/lib/fixtures/topics.ts @@ -17,6 +17,7 @@ export const internalTopicPayload = { segmentSize: 0, segmentCount: 1, underReplicatedPartitions: 0, + messagesCount: 0, partitions: [ { partition: 0, @@ -38,6 +39,7 @@ export const externalTopicPayload = { segmentSize: 1263, segmentCount: 1, underReplicatedPartitions: 0, + messagesCount: 0, partitions: [ { partition: 0,