import React from 'react'; import { TopicWithDetailedInfo } from 'redux/interfaces'; import { TableCellProps } from 'components/common/SmartTable/TableColumn'; import { Tag } from 'components/common/Tag/Tag.styled'; import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted'; import * as S from './List.styled'; export const TitleCell: React.FC< TableCellProps > = ({ dataItem: { internal, name } }) => { return ( <> {internal && IN} {name} ); }; export const TopicSizeCell: React.FC< TableCellProps > = ({ dataItem: { segmentSize } }) => { return ; }; export const OutOfSyncReplicasCell: React.FC< TableCellProps > = ({ dataItem: { partitions } }) => { const data = React.useMemo(() => { if (partitions === undefined || partitions.length === 0) { return 0; } return partitions.reduce((memo, { replicas }) => { const outOfSync = replicas?.filter(({ inSync }) => !inSync); return memo + (outOfSync?.length || 0); }, 0); }, [partitions]); return {data}; }; export const MessagesCell: React.FC< TableCellProps > = ({ dataItem: { partitions } }) => { const data = React.useMemo(() => { if (partitions === undefined || partitions.length === 0) { return 0; } return partitions.reduce((memo, { offsetMax, offsetMin }) => { return memo + (offsetMax - offsetMin); }, 0); }, [partitions]); return {data}; };