import { Link } from 'react-router-dom' import { MessageSquare, CircleDot, CircleCheck } from 'lucide-react' import { formatDistanceToNow } from 'date-fns' import { LabelBadge } from './LabelBadge' import { Status } from '@/__generated__/graphql' interface BugRowProps { id: string humanId: string status: Status title: string labels: Array<{ name: string; color: { R: number; G: number; B: number } }> author: { humanId: string; displayName: string; avatarUrl?: string | null } createdAt: string commentCount: number /** Current repo slug, used to build /:repo/issues/:id and /:repo/user/:id links. */ repo: string | null onLabelClick?: (name: string) => void } // Single row in the issue list. Shows status icon, title, labels, author and // comment count. Labels are clickable to filter the list by that label. export function BugRow({ humanId, status, title, labels, author, createdAt, commentCount, repo, onLabelClick, }: BugRowProps) { const isOpen = status === Status.Open const StatusIcon = isOpen ? CircleDot : CircleCheck const issueHref = repo ? `/${repo}/issues/${humanId}` : `/issues/${humanId}` const authorHref = repo ? `/${repo}/user/${author.humanId}` : `/user/${author.humanId}` return (
{title} {labels.map((label) => ( ))}

#{humanId} opened {formatDistanceToNow(new Date(createdAt), { addSuffix: true })} by{' '} {author.displayName}

{commentCount > 0 && (
{commentCount}
)}
) }