PageTree.tsx 868 B

123456789101112131415161718192021222324252627282930313233343536
  1. import React, { FC, memo } from 'react';
  2. import { useTranslation } from 'react-i18next';
  3. import { useSWRxV5MigrationStatus } from '~/stores/page-listing';
  4. import ItemsTree from './PageTree/ItemsTree';
  5. import PrivateLegacyPages from './PageTree/PrivateLegacyPages';
  6. const PageTree: FC = memo(() => {
  7. const { t } = useTranslation();
  8. const { data } = useSWRxV5MigrationStatus();
  9. return (
  10. <>
  11. <div className="grw-sidebar-content-header p-3">
  12. <h3 className="mb-0">{t('Page Tree')}</h3>
  13. </div>
  14. <div className="grw-sidebar-content-body">
  15. <ItemsTree />
  16. </div>
  17. <div className="grw-sidebar-content-footer">
  18. {
  19. data?.migratablePagesCount != null && data.migratablePagesCount !== 0 && (
  20. <PrivateLegacyPages />
  21. )
  22. }
  23. </div>
  24. </>
  25. );
  26. });
  27. export default PageTree;