ConfigListItem.tsx 655 B

1234567891011121314151617181920212223242526
  1. import { TopicConfig } from 'generated-sources';
  2. import React from 'react';
  3. import * as S from './Settings.styled';
  4. interface ListItemProps {
  5. config: TopicConfig;
  6. }
  7. const ConfigListItem: React.FC<ListItemProps> = ({
  8. config: { name, value, defaultValue },
  9. }) => {
  10. const hasCustomValue = value !== defaultValue;
  11. return (
  12. <S.ConfigList>
  13. <S.ConfigItemCell $hasCustomValue>{name}</S.ConfigItemCell>
  14. <S.ConfigItemCell $hasCustomValue>{value}</S.ConfigItemCell>
  15. <td className="has-text-grey" title="Default Value">
  16. {hasCustomValue && defaultValue}
  17. </td>
  18. </S.ConfigList>
  19. );
  20. };
  21. export default ConfigListItem;