import React from 'react'; import { ClusterId, Topic, TopicDetails, TopicName } from 'types'; import MetricsWrapper from 'components/common/Dashboard/MetricsWrapper'; import Indicator from 'components/common/Dashboard/Indicator'; interface Props extends Topic, TopicDetails { isFetched: boolean; clusterId: ClusterId; topicName: TopicName; fetchTopicDetails: (clusterId: ClusterId, topicName: TopicName) => void; } const Overview: React.FC = ({ isFetched, clusterId, topicName, partitions, underReplicatedPartitions, inSyncReplicas, replicas, partitionCount, internal, replicationFactor, fetchTopicDetails, }) => { React.useEffect( () => { fetchTopicDetails(clusterId, topicName); }, [fetchTopicDetails, clusterId, topicName], ); if (!isFetched) { return null; } return ( <> {partitionCount} {replicationFactor} {underReplicatedPartitions} {inSyncReplicas} of {replicas} {internal ? 'Internal' : 'External'}
{partitions.map(({ partition, leader }) => ( ))}
Partition ID Broker leader
{partition} {leader}
); } export default Overview;