import { FC, ReactNode } from "react"; import { MessageCircle } from "lucide-react"; // hooks import { calculateTimeAgo } from "@/helpers/date-time.helper"; import { useIssueDetail } from "@/hooks/store"; // helpers type TIssueCommentBlock = { commentId: string; ends: "top" | "bottom" | undefined; quickActions: ReactNode; children: ReactNode; }; export const IssueCommentBlock: FC = (props) => { const { commentId, ends, quickActions, children } = props; // hooks const { comment: { getCommentById }, } = useIssueDetail(); const comment = getCommentById(commentId); if (!comment) return <>; return (
{comment.actor_detail.avatar && comment.actor_detail.avatar !== "" ? ( { ) : ( <> {comment.actor_detail.is_bot ? comment.actor_detail.first_name.charAt(0) : comment.actor_detail.display_name.charAt(0)} )}
{comment.actor_detail.is_bot ? comment.actor_detail.first_name + " Bot" : comment.actor_detail.display_name}
commented {calculateTimeAgo(comment.created_at)}
{children}
{quickActions}
); };