Settings.tsx 931 B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react';
  2. import { Table } from 'components/common/table/Table/Table.styled';
  3. import TableHeaderCell from 'components/common/table/TableHeaderCell/TableHeaderCell';
  4. import { RouteParamsClusterTopic } from 'lib/paths';
  5. import useAppParams from 'lib/hooks/useAppParams';
  6. import { useTopicConfig } from 'lib/hooks/api/topics';
  7. import ConfigListItem from './ConfigListItem';
  8. const Settings: React.FC = () => {
  9. const props = useAppParams<RouteParamsClusterTopic>();
  10. const { data } = useTopicConfig(props);
  11. return (
  12. <Table isFullwidth>
  13. <thead>
  14. <tr>
  15. <TableHeaderCell title="Key" />
  16. <TableHeaderCell title="Value" />
  17. <TableHeaderCell title="Default Value" />
  18. </tr>
  19. </thead>
  20. <tbody>
  21. {data?.map((item) => (
  22. <ConfigListItem key={item.name} config={item} />
  23. ))}
  24. </tbody>
  25. </Table>
  26. );
  27. };
  28. export default Settings;