SystemInfomationTable.tsx 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 { growiVersion, nodeVersion, npmVersion, pnpmVersion } =
  11. adminHomeContainer.state;
  12. if (
  13. growiVersion == null ||
  14. nodeVersion == null ||
  15. npmVersion == null ||
  16. pnpmVersion == null
  17. ) {
  18. return <LoadingSpinner />;
  19. }
  20. return (
  21. <table
  22. data-testid="admin-system-information-table"
  23. className="table table-bordered"
  24. >
  25. <tbody>
  26. <tr>
  27. <th>GROWI</th>
  28. <td data-vrt-blackout>{growiVersion}</td>
  29. </tr>
  30. <tr>
  31. <th>node.js</th>
  32. <td>{nodeVersion}</td>
  33. </tr>
  34. <tr>
  35. <th>npm</th>
  36. <td>{npmVersion}</td>
  37. </tr>
  38. <tr>
  39. <th>pnpm</th>
  40. <td>{pnpmVersion}</td>
  41. </tr>
  42. </tbody>
  43. </table>
  44. );
  45. };
  46. /**
  47. * Wrapper component for using unstated
  48. */
  49. const SystemInformationTableWrapper = withUnstatedContainers(
  50. SystemInformationTable,
  51. [AdminHomeContainer],
  52. );
  53. export default SystemInformationTableWrapper;