mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
3d09a69d58
* fix: eslint fixes --------- Co-authored-by: gurusainath <gurusainath007@gmail.com>
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { FC } from "react";
|
|
import { observer } from "mobx-react-lite";
|
|
// hooks
|
|
import { useIssueDetail } from "hooks/store";
|
|
// components
|
|
import { TActivityOperations } from "../root";
|
|
import { IssueCommentCard } from "./comment-card";
|
|
// types
|
|
|
|
type TIssueCommentRoot = {
|
|
workspaceSlug: string;
|
|
issueId: string;
|
|
activityOperations: TActivityOperations;
|
|
showAccessSpecifier?: boolean;
|
|
};
|
|
|
|
export const IssueCommentRoot: FC<TIssueCommentRoot> = observer((props) => {
|
|
const { workspaceSlug, issueId, activityOperations, showAccessSpecifier } = props;
|
|
// hooks
|
|
const {
|
|
comment: { getCommentsByIssueId },
|
|
} = useIssueDetail();
|
|
|
|
const commentIds = getCommentsByIssueId(issueId);
|
|
if (!commentIds) return <></>;
|
|
|
|
return (
|
|
<div>
|
|
{commentIds.map((commentId, index) => (
|
|
<IssueCommentCard
|
|
key={commentId}
|
|
workspaceSlug={workspaceSlug}
|
|
commentId={commentId}
|
|
ends={index === 0 ? "top" : index === commentIds.length - 1 ? "bottom" : undefined}
|
|
activityOperations={activityOperations}
|
|
showAccessSpecifier={showAccessSpecifier}
|
|
/>
|
|
))}
|
|
</div>
|
|
);
|
|
});
|