@@ -11,16 +11,20 @@ import {
1111 XCircleIcon ,
1212} from "lucide-react" ;
1313import { Button } from "../ui/button" ;
14+ import {
15+ getProviderLabel ,
16+ getProviderSetupPhase ,
17+ getProviderStatusDescription ,
18+ getProviderStatusHeading ,
19+ } from "./providerStatusPresentation" ;
1420
1521const PROVIDER_CONFIG = {
1622 codex : {
17- label : "OpenAI (Codex CLI)" ,
1823 installCmd : "npm install -g @openai/codex" ,
1924 authCmd : "codex login" ,
2025 verifyCmd : "codex login status" ,
2126 } ,
2227 claudeAgent : {
23- label : "Anthropic (Claude Code)" ,
2428 installCmd : "npm install -g @anthropic-ai/claude-code" ,
2529 authCmd : "claude auth login" ,
2630 verifyCmd : "claude auth status" ,
@@ -42,6 +46,9 @@ function ProviderRow({ status }: { status: ServerProviderStatus }) {
4246 const [ expanded , setExpanded ] = useState ( status . status !== "ready" ) ;
4347 const config = PROVIDER_CONFIG [ status . provider as keyof typeof PROVIDER_CONFIG ] ;
4448 if ( ! config ) return null ;
49+ const setupPhase = getProviderSetupPhase ( status ) ;
50+ const heading = getProviderStatusHeading ( status ) ;
51+ const description = getProviderStatusDescription ( status ) ;
4552
4653 return (
4754 < div className = "rounded-lg border border-border bg-card/50 p-3" >
@@ -51,28 +58,38 @@ function ProviderRow({ status }: { status: ServerProviderStatus }) {
5158 onClick = { ( ) => setExpanded ( ( v ) => ! v ) }
5259 >
5360 < StatusIcon status = { status . status } />
54- < span className = "flex-1 font-medium text-foreground" > { config . label } </ span >
61+ < span className = "flex-1 font-medium text-foreground" >
62+ { getProviderLabel ( status . provider ) }
63+ </ span >
64+ { status . status !== "ready" ? (
65+ < span className = "rounded-full border border-border bg-background px-2 py-0.5 text-[10px] font-medium tracking-[0.08em] text-muted-foreground uppercase" >
66+ { setupPhase }
67+ </ span >
68+ ) : null }
5569 { expanded ? (
5670 < ChevronDownIcon className = "size-3.5 text-muted-foreground" />
5771 ) : (
5872 < ChevronRightIcon className = "size-3.5 text-muted-foreground" />
5973 ) }
6074 </ button >
6175
62- { status . status !== "ready" && status . message && (
63- < p className = "mt-1.5 ml-6.5 text-xs text-muted-foreground" > { status . message } </ p >
76+ { status . status !== "ready" && (
77+ < div className = "mt-1.5 ml-6.5 space-y-1" >
78+ < p className = "text-xs font-medium text-foreground" > { heading } </ p >
79+ < p className = "text-xs text-muted-foreground" > { description } </ p >
80+ </ div >
6481 ) }
6582
6683 { expanded && status . status !== "ready" && (
6784 < div className = "mt-3 ml-6.5 space-y-2" >
6885 < div className = "space-y-1.5" >
69- < Step n = { 1 } label = "Install" >
86+ < Step n = { 1 } label = "Install" active = { setupPhase === "install" } >
7087 < Code > { config . installCmd } </ Code >
7188 </ Step >
72- < Step n = { 2 } label = "Authenticate" >
89+ < Step n = { 2 } label = "Authenticate" active = { setupPhase === "authenticate" } >
7390 < Code > { config . authCmd } </ Code >
7491 </ Step >
75- < Step n = { 3 } label = "Verify" >
92+ < Step n = { 3 } label = "Verify" active = { setupPhase === "verify" } >
7693 < Code > { config . verifyCmd } </ Code >
7794 </ Step >
7895 </ div >
@@ -86,10 +103,24 @@ function ProviderRow({ status }: { status: ServerProviderStatus }) {
86103 ) ;
87104}
88105
89- function Step ( { n, label, children } : { n : number ; label : string ; children : React . ReactNode } ) {
106+ function Step ( {
107+ n,
108+ label,
109+ active,
110+ children,
111+ } : {
112+ n : number ;
113+ label : string ;
114+ active : boolean ;
115+ children : React . ReactNode ;
116+ } ) {
90117 return (
91118 < div className = "flex items-baseline gap-2 text-xs" >
92- < span className = "shrink-0 text-muted-foreground" >
119+ < span
120+ className = {
121+ active ? "shrink-0 font-medium text-foreground" : "shrink-0 text-muted-foreground"
122+ }
123+ >
93124 { n } . { label } :
94125 </ span >
95126 { children }
0 commit comments