PageContentFooter.tsx 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. return <></>;
  19. }
  20. return (
  21. <div
  22. className={`${styles['page-content-footer']} my-4 pt-4 d-edit-none d-print-none}`}
  23. >
  24. <div className="page-meta">
  25. <AuthorInfo
  26. user={creator}
  27. date={createdAt}
  28. mode="create"
  29. locate="footer"
  30. />
  31. <AuthorInfo
  32. user={lastUpdateUser}
  33. date={updatedAt}
  34. mode="update"
  35. locate="footer"
  36. />
  37. </div>
  38. </div>
  39. );
  40. };