mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
8a95a41100
Co-authored-by: Bavisetti Narayan <72156168+NarayanBavisetti@users.noreply.github.com> Co-authored-by: NarayanBavisetti <narayan3119@gmail.com> Co-authored-by: Bavisetti Narayan <narayan@Bavisettis-MacBook-Pro.local> Co-authored-by: Nikhil <118773738+pablohashescobar@users.noreply.github.com> Co-authored-by: M. Palanikannan <73993394+Palanikannan1437@users.noreply.github.com> Co-authored-by: Lakhan Baheti <94619783+1akhanBaheti@users.noreply.github.com> Co-authored-by: Dakshesh Jain <65905942+dakshesh14@users.noreply.github.com> Co-authored-by: Aaryan Khandelwal <65252264+aaryan610@users.noreply.github.com>
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import React, { useEffect } from "react";
|
|
import { useRouter } from "next/router";
|
|
import { observer } from "mobx-react-lite";
|
|
// lib
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
// components
|
|
import { CommentCard, AddComment } from "components/issues/peek-overview";
|
|
// types
|
|
import { IIssue } from "types/issue";
|
|
|
|
type Props = {
|
|
issueDetails: IIssue;
|
|
};
|
|
|
|
export const PeekOverviewIssueActivity: React.FC<Props> = observer((props) => {
|
|
const router = useRouter();
|
|
const { workspace_slug } = router.query;
|
|
|
|
const { issueDetails: issueDetailStore, project: projectStore, user: userStore } = useMobxStore();
|
|
|
|
const comments = issueDetailStore.details[issueDetailStore.peekId || ""]?.comments || [];
|
|
|
|
console.log("issueDetailStore", issueDetailStore);
|
|
|
|
return (
|
|
<div>
|
|
<h4 className="font-medium">Activity</h4>
|
|
{workspace_slug && (
|
|
<div className="mt-4">
|
|
<div className="space-y-4">
|
|
{comments.map((comment: any) => (
|
|
<CommentCard key={comment.id} comment={comment} workspaceSlug={workspace_slug?.toString()} />
|
|
))}
|
|
</div>
|
|
{projectStore.deploySettings?.comments && (
|
|
<div className="mt-4">
|
|
<AddComment disabled={!userStore.currentUser} />
|
|
</div>
|
|
)}
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
});
|