import React from 'react'; import { ClusterName, TopicName } from 'redux/interfaces'; import { Topic, TopicDetails } from 'generated-sources'; import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper'; import Indicator from 'components/common/Dashboard/Indicator'; import BytesFormatted from 'components/common/BytesFormatted/BytesFormatted'; interface Props extends Topic, TopicDetails { isFetched: boolean; clusterName: ClusterName; topicName: TopicName; fetchTopicDetails: (clusterName: ClusterName, topicName: TopicName) => void; } const Overview: React.FC = ({ isFetched, clusterName, topicName, partitions, underReplicatedPartitions, inSyncReplicas, replicas, partitionCount, internal, replicationFactor, segmentSize, segmentCount, fetchTopicDetails, }) => { React.useEffect(() => { fetchTopicDetails(clusterName, topicName); }, [fetchTopicDetails, clusterName, topicName]); if (!isFetched) { return null; } return ( <> {partitionCount} {replicationFactor} {underReplicatedPartitions} {inSyncReplicas} {' '} of {replicas} {internal ? 'Internal' : 'External'} {segmentCount}
{partitions && partitions.map(({ partition, leader, offsetMin, offsetMax }) => ( ))}
Partition ID Broker leader Min offset Max offset
{partition} {leader} {offsetMin} {offsetMax}
); }; export default Overview;