import React from 'react'; import { IRevisionHasId } from '@growi/core'; import dynamic from 'next/dynamic'; import { PageComment } from '~/components/PageComment'; import { useSWRxPageComment } from '~/stores/comment'; import { useIsTrashPage, useCurrentUser } from '../stores/context'; import { CommentEditorProps } from './PageComment/CommentEditor'; const CommentEditor = dynamic(() => import('./PageComment/CommentEditor').then(mod => mod.CommentEditor), { ssr: false }); type CommentsProps = { pageId: string, revision: IRevisionHasId, } export const Comments = (props: CommentsProps): JSX.Element => { const { pageId, revision } = props; const { mutate } = useSWRxPageComment(pageId); const { data: isDeleted } = useIsTrashPage(); const { data: currentUser } = useCurrentUser(); if (pageId == null) { return <>; } return ( // TODO: Check and refactor CSS import
{ !isDeleted && (
)}
); };