import React from 'react'; import { ClusterName, TopicName, TopicConfig } from 'redux/interfaces'; interface Props { clusterName: ClusterName; topicName: TopicName; config?: TopicConfig[]; isFetched: boolean; fetchTopicConfig: (clusterName: ClusterName, topicName: TopicName) => void; } const ConfigListItem: React.FC = ({ name, value, defaultValue, }) => { const hasCustomValue = value !== defaultValue; return ( {name} {value} {hasCustomValue && defaultValue} ) }; const Sertings: React.FC = ({ clusterName, topicName, isFetched, fetchTopicConfig, config, }) => { React.useEffect( () => { fetchTopicConfig(clusterName, topicName); }, [fetchTopicConfig, clusterName, topicName], ); if (!isFetched || !config) { return null; } return (
{config.map((item, index) => )}
Key Value Default Value
); }; export default Sertings;