NotFoundPage.tsx 1.3 KB

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