@@ -11,7 +11,7 @@ import {
1111 type VcsStatusResult ,
1212} from "@t3tools/contracts" ;
1313import { Atom } from "effect/unstable/reactivity" ;
14- import { FolderGit2Icon , GitPullRequestIcon , TerminalIcon } from "lucide-react" ;
14+ import { FolderGit2Icon , TerminalIcon } from "lucide-react" ;
1515import { useMemo } from "react" ;
1616import { appAtomRegistry } from "../rpc/atomRegistry" ;
1717import { useEnvironment , usePrimaryEnvironmentId } from "../state/environments" ;
@@ -24,6 +24,7 @@ import { vcsEnvironment } from "../state/vcs";
2424import { useUiStateStore } from "../uiStateStore" ;
2525import { resolveChangeRequestPresentation } from "../sourceControlPresentation" ;
2626import { resolveThreadStatusPill , type ThreadStatusPill } from "./Sidebar.logic" ;
27+ import { resolvePullRequestState } from "./pullRequest/pullRequestPresentation" ;
2728import type { SidebarThreadSummary } from "../types" ;
2829import { formatWorktreePathForDisplay } from "../worktreeCleanup" ;
2930import { Tooltip , TooltipPopup , TooltipTrigger } from "./ui/tooltip" ;
@@ -155,8 +156,16 @@ export function prStatusIndicator(
155156 return null ;
156157}
157158
158- export function ChangeRequestStatusIcon ( { className } : { className ?: string } ) {
159- return < GitPullRequestIcon className = { className } /> ;
159+ export function ChangeRequestStatusIcon ( {
160+ state,
161+ isDraft = false ,
162+ className,
163+ } : Pick < NonNullable < ThreadPr > , "state" > & {
164+ readonly isDraft ?: boolean | undefined ;
165+ readonly className ?: string | undefined ;
166+ } ) {
167+ const presentation = resolvePullRequestState ( { state, isDraft } ) ;
168+ return < presentation . Icon className = { className } /> ;
160169}
161170
162171export function PrStatusTooltipContent ( { status } : { status : PrStatusIndicator } ) {
@@ -585,7 +594,7 @@ export function ThreadRowLeadingStatus({ thread }: { thread: SidebarThreadSummar
585594
586595 return (
587596 < span className = "inline-flex shrink-0 items-center gap-1.5" >
588- { prStatus ? (
597+ { prStatus && pr ? (
589598 < Tooltip >
590599 < TooltipTrigger
591600 render = {
@@ -595,7 +604,7 @@ export function ThreadRowLeadingStatus({ thread }: { thread: SidebarThreadSummar
595604 />
596605 }
597606 >
598- < ChangeRequestStatusIcon className = "size-3" />
607+ < ChangeRequestStatusIcon state = { pr . state } isDraft = { pr . isDraft } className = "size-3" />
599608 </ TooltipTrigger >
600609 < TooltipPopup side = "top" >
601610 < PrStatusTooltipContent status = { prStatus } />
0 commit comments