"use client"; import React from "react"; import { observer } from "mobx-react-lite"; import Link from "next/link"; import { usePathname } from "next/navigation"; import { Button } from "@plane/ui"; // components import { CommentCard, AddComment } from "@/components/issues/peek-overview"; import { Icon } from "@/components/ui"; // hooks import { useIssueDetails, usePublish, useUser } from "@/hooks/store"; import useIsInIframe from "@/hooks/use-is-in-iframe"; // types import { IIssue } from "@/types/issue"; type Props = { anchor: string; issueDetails: IIssue; }; export const PeekOverviewIssueActivity: React.FC = observer((props) => { const { anchor } = props; // router const pathname = usePathname(); // store hooks const { details, peekId } = useIssueDetails(); const { data: currentUser } = useUser(); const { canComment } = usePublish(anchor); // derived values const comments = details[peekId || ""]?.comments || []; const isInIframe = useIsInIframe(); return (

Comments

{comments.map((comment) => ( ))}
{!isInIframe && (currentUser ? ( <> {canComment && (
)} ) : (

Sign in to add your comment

))}
); });