NotFoundPage.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. index: 0,
  21. },
  22. timeLine: {
  23. Icon: TimeLineIcon,
  24. Content: PageTimeline,
  25. i18n: t('Timeline View'),
  26. index: 1,
  27. },
  28. };
  29. }, [path, t]);
  30. return (
  31. <div className="d-edit-none">
  32. <CustomNavAndContents navTabMapping={navTabMapping} tabContentClasses={['py-4']} />
  33. </div>
  34. );
  35. };
  36. export default NotFoundPage;