mirror of
https://github.com/docmost/docmost.git
synced 2025-11-14 05:31:11 +10:00
23 lines
683 B
TypeScript
23 lines
683 B
TypeScript
import { useParams } from 'react-router-dom';
|
|
import React from 'react';
|
|
import classes from '@/features/comment/components/comment.module.css';
|
|
import { Text } from '@mantine/core';
|
|
import CommentList from '@/features/comment/components/comment-list';
|
|
import { useCommentsQuery } from '@/features/comment/queries/comment';
|
|
|
|
export default function Comments() {
|
|
const { pageId } = useParams();
|
|
const { data, isLoading, isError } = useCommentsQuery(pageId);
|
|
|
|
if (isLoading) {
|
|
return <></>;
|
|
}
|
|
|
|
return (
|
|
<div className={classes.wrapper}>
|
|
<Text mb="md" fw={500}>Comments</Text>
|
|
{data ? <CommentList comments={data} /> : 'No comments yet'}
|
|
</div>
|
|
);
|
|
}
|