import { Link } from "@tanstack/react-router"; import { Badge, EmptyState, LabelChip, RelativeTime } from "./ui/Primitives"; import { cn } from "~/utils/cn"; type Item = { number: number; title: string; state: "open" | "closed"; author: { name: string }; commentsCount: number; createdAt: number; labels: Array<{ id: string; name: string; color: string }>; draft: boolean; merged: boolean; }; function StateIcon({ item, kind }: { item: Item; kind: "issue" | "pull" }) { const tone = item.merged ? "text-violet-400" : item.state === "open" ? item.draft ? "text-gray-400" : "text-emerald-400" : kind === "pull" ? "text-red-400" : "text-violet-400"; const glyph = kind === "pull" ? (item.merged ? "⇢" : "⇄") : item.state === "open" ? "◉" : "✓"; return ( {glyph} ); } export function IssueList({ owner, repo, items, kind, }: { owner: string; repo: string; items: Item[]; kind: "issue" | "pull"; }) { if (items.length === 0) return ; return ( ); }