@@ -7,14 +7,8 @@ import type {
77} from "@t3tools/contracts" ;
88import { useIsMutating , useMutation , useQueryClient } from "@tanstack/react-query" ;
99import { useCallback , useEffect , useEffectEvent , useMemo , useRef , useState } from "react" ;
10- import {
11- ChevronDownIcon ,
12- CloudUploadIcon ,
13- GitCommitIcon ,
14- GitPullRequestIcon ,
15- InfoIcon ,
16- } from "lucide-react" ;
17- import { GitHubIcon , GitLabIcon } from "./Icons" ;
10+ import { ChevronDownIcon , CloudUploadIcon , GitCommitIcon , InfoIcon } from "lucide-react" ;
11+ import { ChangeRequestStatusIcon } from "./ThreadStatusIndicators" ;
1812import {
1913 buildGitActionProgressStages ,
2014 buildMenuItems ,
@@ -202,18 +196,6 @@ const COMMIT_DIALOG_TITLE = "Commit changes";
202196const COMMIT_DIALOG_DESCRIPTION =
203197 "Review and confirm your commit. Leave the message blank to auto-generate one." ;
204198
205- function ChangeRequestIcon ( {
206- presentation,
207- className,
208- } : {
209- presentation : ChangeRequestPresentation ;
210- className ?: string ;
211- } ) {
212- if ( presentation . icon === "github" ) return < GitHubIcon className = { className } /> ;
213- if ( presentation . icon === "gitlab" ) return < GitLabIcon className = { className } /> ;
214- return < GitPullRequestIcon className = { className } /> ;
215- }
216-
217199function GitActionItemIcon ( {
218200 icon,
219201 changeRequestPresentation,
@@ -223,7 +205,7 @@ function GitActionItemIcon({
223205} ) {
224206 if ( icon === "commit" ) return < GitCommitIcon /> ;
225207 if ( icon === "push" ) return < CloudUploadIcon /> ;
226- return < ChangeRequestIcon presentation = { changeRequestPresentation } /> ;
208+ return < ChangeRequestStatusIcon icon = { changeRequestPresentation . icon } /> ;
227209}
228210
229211function GitQuickActionIcon ( {
@@ -235,15 +217,19 @@ function GitQuickActionIcon({
235217} ) {
236218 const iconClassName = "size-3.5" ;
237219 if ( quickAction . kind === "open_pr" ) {
238- return < ChangeRequestIcon presentation = { changeRequestPresentation } className = { iconClassName } /> ;
220+ return (
221+ < ChangeRequestStatusIcon icon = { changeRequestPresentation . icon } className = { iconClassName } />
222+ ) ;
239223 }
240224 if ( quickAction . kind === "run_pull" ) return < InfoIcon className = { iconClassName } /> ;
241225 if ( quickAction . kind === "run_action" ) {
242226 if ( quickAction . action === "commit" ) return < GitCommitIcon className = { iconClassName } /> ;
243227 if ( quickAction . action === "push" || quickAction . action === "commit_push" ) {
244228 return < CloudUploadIcon className = { iconClassName } /> ;
245229 }
246- return < ChangeRequestIcon presentation = { changeRequestPresentation } className = { iconClassName } /> ;
230+ return (
231+ < ChangeRequestStatusIcon icon = { changeRequestPresentation . icon } className = { iconClassName } />
232+ ) ;
247233 }
248234 if ( quickAction . label === "Commit" ) return < GitCommitIcon className = { iconClassName } /> ;
249235 return < InfoIcon className = { iconClassName } /> ;
0 commit comments