diff --git a/ui/src/components/cliproxy/routing-guidance-card.tsx b/ui/src/components/cliproxy/routing-guidance-card.tsx index d3d330bf..1fb1eac9 100644 --- a/ui/src/components/cliproxy/routing-guidance-card.tsx +++ b/ui/src/components/cliproxy/routing-guidance-card.tsx @@ -1,5 +1,5 @@ import { useState } from 'react'; -import { ArrowRightLeft, ChevronDown, ChevronUp } from 'lucide-react'; +import { ArrowRightLeft, ChevronDown, ChevronUp, RefreshCw } from 'lucide-react'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import type { CliproxyRoutingState, RoutingStrategy } from '@/lib/api-client'; @@ -43,88 +43,48 @@ export function RoutingGuidanceCard({ const detailToggleLabel = detailsOpen ? 'Hide details' : 'Show details'; if (compact) { - const statusLine = selected === 'fill-first' ? 'One account first' : 'Balanced usage'; + const handleApply = (s: RoutingStrategy) => { + setSelected(s); + if (s !== currentStrategy) { + onApply(s); + } + }; return ( -
-
-
-
-
- -
-
-
- - Routing - - - {currentStrategy} - -
-

{statusLine}

-
-
- - {!state?.reachable ? ( - - Saved default - - ) : null} -
- -
-
- {( - Object.entries(STRATEGY_COPY) as Array< - [RoutingStrategy, { title: string; description: string }] - > - ).map(([strategy, copy]) => { - const active = selected === strategy; - return ( - - ); - })} -
- -
-
- Proxy-wide - {state?.source === 'config' ? ( - <> - - Local - - ) : null} -
- -
+
+
+ + Routing + {isSaving && }
-
+ +
+ {( + Object.entries(STRATEGY_COPY) as Array< + [RoutingStrategy, { title: string; description: string }] + > + ).map(([strategy, copy]) => { + const active = selected === strategy; + return ( + + ); + })} +
+ ); }