diff --git a/apps/client/src/features/comment/components/comment-list-with-tabs.tsx b/apps/client/src/features/comment/components/comment-list-with-tabs.tsx index 70d3107f..92413b75 100644 --- a/apps/client/src/features/comment/components/comment-list-with-tabs.tsx +++ b/apps/client/src/features/comment/components/comment-list-with-tabs.tsx @@ -1,6 +1,17 @@ import React, { useState, useRef, useCallback, memo, useMemo } from "react"; import { useParams } from "react-router-dom"; -import { ActionIcon, Center, Divider, Group, Paper, Stack, Tabs, Badge, Text, ScrollArea } from "@mantine/core"; +import { + ActionIcon, + Center, + Divider, + Group, + Paper, + Stack, + Tabs, + Badge, + Text, + ScrollArea, +} from "@mantine/core"; import CommentListItem from "@/features/comment/components/comment-list-item"; import { useCommentsQuery, @@ -29,7 +40,6 @@ function CommentListWithTabs() { } = useCommentsQuery({ pageId: page?.id }); const createCommentMutation = useCreateCommentMutation(); const [isLoading, setIsLoading] = useState(false); - const isCloudEE = useIsCloudEE(); const { data: space } = useGetSpaceBySlugQuery(page?.space?.slug); const canComment = page?.permissions?.canEdit ?? false; @@ -68,7 +78,10 @@ function CommentListWithTabs() { setTimeout(() => { const selector = `div[data-comment-id="${createdComment.id}"]`; const commentElement = document.querySelector(selector); - commentElement?.scrollIntoView({ behavior: "smooth", block: "center" }); + commentElement?.scrollIntoView({ + behavior: "smooth", + block: "center", + }); }, 400); } catch (error) { console.error("Failed to post comment:", error); @@ -158,59 +171,6 @@ function CommentListWithTabs() { /> ) : null; - // If not cloud/enterprise, show simple list without tabs - if (!isCloudEE) { - return ( -
- -
- {comments?.items - .filter((comment: IComment) => comment.parentCommentId === null) - .map((comment) => ( - -
- - -
- - {canComment && ( - <> - - - - )} -
- ))} -
-
- {pageCommentInput} -
- ); - } - return (
- + - + {t("No open comments.")} @@ -269,7 +242,11 @@ function CommentListWithTabs() { {resolvedComments.length === 0 ? (
- + {t("No resolved comments.")} @@ -279,7 +256,6 @@ function CommentListWithTabs() { resolvedComments.map(renderComments) )} -
@@ -335,7 +311,12 @@ const ChildComments = ({ const MemoizedChildComments = memo(ChildComments); -const CommentEditorWithActions = ({ commentId, onSave, isLoading, placeholder = undefined }) => { +const CommentEditorWithActions = ({ + commentId, + onSave, + isLoading, + placeholder = undefined, +}) => { const [content, setContent] = useState(""); const { ref, focused } = useFocusWithin(); const commentEditorRef = useRef(null); @@ -373,7 +354,16 @@ const PageCommentInput = ({ onSave, isLoading }) => { }, [content, onSave]); return ( -
+