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