SystemInfomationTable.tsx 1.3 KB

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