CommentEditorLazyRenderer.tsx 510 B

12345678910111213141516171819202122232425
  1. import React, { FC } from 'react';
  2. import { useSWRxPageComment } from '../../stores/comment';
  3. import { CommentEditor } from './CommentEditor';
  4. type Props = {
  5. pageId: string,
  6. }
  7. const CommentEditorLazyRenderer:FC<Props> = (props:Props):JSX.Element => {
  8. const { pageId } = props;
  9. const { mutate } = useSWRxPageComment(pageId);
  10. return (
  11. <CommentEditor
  12. replyTo={undefined}
  13. onCommentButtonClicked={mutate}
  14. isForNewComment
  15. />
  16. );
  17. };
  18. export default CommentEditorLazyRenderer;