import { useParams, Link } from 'react-router-dom' import { ArrowLeft } from 'lucide-react' import { formatDistanceToNow } from 'date-fns' import { Skeleton } from '@/components/ui/skeleton' import { Separator } from '@/components/ui/separator' import { StatusBadge } from '@/components/bugs/StatusBadge' import { LabelEditor } from '@/components/bugs/LabelEditor' import { TitleEditor } from '@/components/bugs/TitleEditor' import { Timeline } from '@/components/bugs/Timeline' import { CommentBox } from '@/components/bugs/CommentBox' import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar' import { useBugDetailQuery } from '@/__generated__/graphql' import { useRepo } from '@/lib/repo' // Issue detail page (/:repo/issues/:id). Shows title, status, timeline of // comments and events, and a sidebar with labels and participants. export function BugDetailPage() { const { id } = useParams<{ id: string }>() const repo = useRepo() const { data, loading, error } = useBugDetailQuery({ variables: { ref: repo, prefix: id! }, }) if (error) { return (