NotFoundPage.tsx 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import React, { useMemo } from 'react';
  2. import { useTranslation } from 'next-i18next';
  3. import CustomNavAndContents from './CustomNavigation/CustomNavAndContents';
  4. import { DescendantsPageList } from './DescendantsPageList';
  5. import PageListIcon from './Icons/PageListIcon';
  6. import TimeLineIcon from './Icons/TimeLineIcon';
  7. import { PageTimeline } from './PageTimeline';
  8. type NotFoundPageProps = {
  9. path: string,
  10. }
  11. const NotFoundPage = (props: NotFoundPageProps): JSX.Element => {
  12. const { t } = useTranslation();
  13. const { path } = props;
  14. const navTabMapping = useMemo(() => {
  15. return {
  16. pagelist: {
  17. Icon: PageListIcon,
  18. Content: () => <DescendantsPageList path={path}/>,
  19. i18n: t('page_list'),
  20. },
  21. timeLine: {
  22. Icon: TimeLineIcon,
  23. Content: PageTimeline,
  24. i18n: t('Timeline View'),
  25. },
  26. };
  27. }, [path, t]);
  28. return (
  29. <div className="d-edit-none">
  30. <CustomNavAndContents navTabMapping={navTabMapping} tabContentClasses={['py-4']} />
  31. </div>
  32. );
  33. };
  34. export default NotFoundPage;