SystemInfomationTable.tsx 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import React from 'react';
  2. import AdminHomeContainer from '~/client/services/AdminHomeContainer';
  3. import { withUnstatedContainers } from '../../UnstatedUtils';
  4. type Props = {
  5. adminHomeContainer: AdminHomeContainer,
  6. }
  7. const SystemInformationTable = (props: Props) => {
  8. const { adminHomeContainer } = props;
  9. const {
  10. growiVersion, nodeVersion, npmVersion, yarnVersion,
  11. } = adminHomeContainer.state;
  12. if (growiVersion == null || nodeVersion == null || npmVersion == null || yarnVersion == null) {
  13. return <></>;
  14. }
  15. return (
  16. <table data-testid="admin-system-information-table" className="table table-bordered">
  17. <tbody>
  18. <tr>
  19. <th>GROWI</th>
  20. <td data-vrt-blackout>{ growiVersion }</td>
  21. </tr>
  22. <tr>
  23. <th>node.js</th>
  24. <td>{ nodeVersion }</td>
  25. </tr>
  26. <tr>
  27. <th>npm</th>
  28. <td>{ npmVersion }</td>
  29. </tr>
  30. <tr>
  31. <th>yarn</th>
  32. <td>{ yarnVersion }</td>
  33. </tr>
  34. </tbody>
  35. </table>
  36. );
  37. };
  38. /**
  39. * Wrapper component for using unstated
  40. */
  41. const SystemInformationTableWrapper = withUnstatedContainers(SystemInformationTable, [AdminHomeContainer]);
  42. export default SystemInformationTableWrapper;