import { Eye } from "lucide-react"; import type { IssueProductivityReview } from "@paperclipai/shared"; import { Link } from "../lib/router"; import { cn } from "../lib/utils"; import { createIssueDetailPath } from "../lib/issueDetailBreadcrumb"; import { Tooltip, TooltipContent, TooltipTrigger } from "./ui/tooltip"; const TRIGGER_LABELS: Record = { no_comment_streak: "No-comment streak", long_active_duration: "Long active duration", high_churn: "High churn", }; const REVIEW_STATUS_LABELS: Record = { todo: "Open", in_progress: "In progress", in_review: "In review", blocked: "Blocked", backlog: "Open", }; export function productivityReviewTriggerLabel( trigger: IssueProductivityReview["trigger"], ): string { if (!trigger) return "Productivity review"; return TRIGGER_LABELS[trigger] ?? "Productivity review"; } export function ProductivityReviewBadge({ review, className, hideLabel = false, }: { review: IssueProductivityReview; className?: string; hideLabel?: boolean; }) { const label = productivityReviewTriggerLabel(review.trigger); const reviewIdentifier = review.reviewIdentifier ?? review.reviewIssueId.slice(0, 8); const reviewPath = createIssueDetailPath(review.reviewIdentifier ?? review.reviewIssueId); const statusLabel = REVIEW_STATUS_LABELS[review.status] ?? review.status.replace(/_/g, " "); return ( {hideLabel ? null : Under review}
Productivity review open
Trigger: {label}
{typeof review.noCommentStreak === "number" && review.noCommentStreak > 0 ? (
No-comment streak:{" "} {review.noCommentStreak} runs
) : null}
Review: {reviewIdentifier} ({statusLabel})
); }