PageContentFooter.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import type { JSX } from 'react';
  2. import dynamic from 'next/dynamic';
  3. import type { IPage, IPagePopulatedToShowRevision } from '@growi/core';
  4. import styles from './PageContentFooter.module.scss';
  5. const AuthorInfo = dynamic(
  6. () => import('~/client/components/AuthorInfo').then((mod) => mod.AuthorInfo),
  7. { ssr: false },
  8. );
  9. export type PageContentFooterProps = {
  10. page: IPage | IPagePopulatedToShowRevision;
  11. };
  12. export const PageContentFooter = (
  13. props: PageContentFooterProps,
  14. ): JSX.Element => {
  15. const { page } = props;
  16. const { creator, lastUpdateUser, createdAt, updatedAt } = page;
  17. if (page.isEmpty) {
  18. // biome-ignore lint/complexity/noUselessFragments: ignore
  19. return <></>;
  20. }
  21. return (
  22. <div
  23. className={`${styles['page-content-footer']} my-4 pt-4 d-edit-none`}
  24. >
  25. <div className="page-meta">
  26. <AuthorInfo
  27. user={creator}
  28. date={createdAt}
  29. mode="create"
  30. locate="footer"
  31. />
  32. <AuthorInfo
  33. user={lastUpdateUser}
  34. date={updatedAt}
  35. mode="update"
  36. locate="footer"
  37. />
  38. </div>
  39. </div>
  40. );
  41. };