forked from github/plane
chore: issue comment empty state added (#4202)
This commit is contained in:
parent
18b573531f
commit
0a6d7713fb
@ -1,5 +1,9 @@
|
|||||||
import { FC } from "react";
|
import { FC } from "react";
|
||||||
import { observer } from "mobx-react-lite";
|
import { observer } from "mobx-react-lite";
|
||||||
|
// components
|
||||||
|
import { EmptyState } from "@/components/empty-state";
|
||||||
|
// hooks
|
||||||
|
import { EmptyStateType } from "@/constants/empty-state";
|
||||||
// hooks
|
// hooks
|
||||||
import { useIssueDetail } from "@/hooks/store";
|
import { useIssueDetail } from "@/hooks/store";
|
||||||
// components
|
// components
|
||||||
@ -28,18 +32,24 @@ export const IssueCommentRoot: FC<TIssueCommentRoot> = observer((props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
{commentIds.map((commentId, index) => (
|
{commentIds.length > 0 ? (
|
||||||
<IssueCommentCard
|
commentIds.map((commentId, index) => (
|
||||||
projectId={projectId}
|
<IssueCommentCard
|
||||||
key={commentId}
|
projectId={projectId}
|
||||||
workspaceSlug={workspaceSlug}
|
key={commentId}
|
||||||
commentId={commentId}
|
workspaceSlug={workspaceSlug}
|
||||||
ends={index === 0 ? "top" : index === commentIds.length - 1 ? "bottom" : undefined}
|
commentId={commentId}
|
||||||
activityOperations={activityOperations}
|
ends={index === 0 ? "top" : index === commentIds.length - 1 ? "bottom" : undefined}
|
||||||
showAccessSpecifier={showAccessSpecifier}
|
activityOperations={activityOperations}
|
||||||
disabled={disabled}
|
showAccessSpecifier={showAccessSpecifier}
|
||||||
/>
|
disabled={disabled}
|
||||||
))}
|
/>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<div className="flex items-center justify-center py-9">
|
||||||
|
<EmptyState type={EmptyStateType.ISSUE_COMMENT_EMPTY_STATE} layout="screen-simple" />
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@ -532,7 +532,7 @@ const emptyStateDetails = {
|
|||||||
[EmptyStateType.ISSUE_COMMENT_EMPTY_STATE]: {
|
[EmptyStateType.ISSUE_COMMENT_EMPTY_STATE]: {
|
||||||
key: EmptyStateType.ISSUE_COMMENT_EMPTY_STATE,
|
key: EmptyStateType.ISSUE_COMMENT_EMPTY_STATE,
|
||||||
title: "No comments yet",
|
title: "No comments yet",
|
||||||
description: "Comments can be used as a discussion and follow-up space for the issues",
|
description: "Comments can be used as a discussion and \n follow-up space for the issues",
|
||||||
path: "/empty-state/search/comments",
|
path: "/empty-state/search/comments",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user