File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99} from "react" ;
1010
1111import { cn } from "~/lib/utils" ;
12- import { PullRequestGlyph } from "~/components/pullRequest/pullRequestIcons" ;
12+ import { PULL_REQUEST_STATE_PRESENTATION } from "~/components/pullRequest/pullRequestIcons" ;
1313import { PierreEntryIcon } from "./chat/PierreEntryIcon" ;
1414import {
1515 COMPOSER_INLINE_CHIP_ICON_CLASS_NAME ,
@@ -123,6 +123,9 @@ export function PullRequestChip(props: {
123123 onOpen : ( event : MouseEvent < HTMLElement > , url : string ) => void ;
124124} ) {
125125 const previewTarget = usePullRequestPreviewTarget ( props . environmentId , props . metadata . url ) ;
126+ const displayState =
127+ props . metadata . state === "open" && props . metadata . isDraft ? "draft" : props . metadata . state ;
128+ const StateIcon = PULL_REQUEST_STATE_PRESENTATION [ displayState ] . Icon ;
126129 const button = (
127130 < Button
128131 variant = "chip"
@@ -136,9 +139,7 @@ export function PullRequestChip(props: {
136139 data-markdown-copy = { props . copyMarkdown }
137140 onClick = { ( event ) => props . onOpen ( event , props . metadata . url ) }
138141 >
139- < PullRequestGlyph . pullRequest
140- className = { cn ( COMPOSER_INLINE_CHIP_ICON_CLASS_NAME , "size-3.5" ) }
141- />
142+ < StateIcon className = { cn ( COMPOSER_INLINE_CHIP_ICON_CLASS_NAME , "size-3.5" ) } />
142143 < span className = { props . labelClassName } > { props . label } </ span >
143144 </ Button >
144145 ) ;
You can’t perform that action at this time.
0 commit comments