@@ -2,20 +2,14 @@ import { useCallback, useState } from "react"
22import { Trans } from "react-i18next"
33import { Checkbox } from "vscrui"
44import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
5- import { ExternalLinkIcon } from "@radix-ui/react-icons"
65
76import { type ProviderSettings , type OrganizationAllowList , openRouterDefaultModelId } from "@roo-code/types"
87
98import type { RouterModels } from "@roo/api"
109
1110import { useAppTranslation } from "@src/i18n/TranslationContext"
1211import { getOpenRouterAuthUrl } from "@src/oauth/urls"
13- import {
14- useOpenRouterModelProviders ,
15- OPENROUTER_DEFAULT_PROVIDER_NAME ,
16- } from "@src/components/ui/hooks/useOpenRouterModelProviders"
1712import { VSCodeButtonLink } from "@src/components/common/VSCodeButtonLink"
18- import { Select , SelectContent , SelectItem , SelectTrigger , SelectValue } from "@src/components/ui"
1913
2014import { inputEventTransform , noTransform } from "../transforms"
2115
@@ -37,7 +31,6 @@ export const OpenRouter = ({
3731 apiConfiguration,
3832 setApiConfigurationField,
3933 routerModels,
40- selectedModelId,
4134 uriScheme,
4235 fromWelcomeView,
4336 organizationAllowList,
@@ -58,14 +51,6 @@ export const OpenRouter = ({
5851 [ setApiConfigurationField ] ,
5952 )
6053
61- const { data : openRouterModelProviders } = useOpenRouterModelProviders ( apiConfiguration ?. openRouterModelId , {
62- enabled :
63- ! ! apiConfiguration ?. openRouterModelId &&
64- routerModels ?. openrouter &&
65- Object . keys ( routerModels . openrouter ) . length > 1 &&
66- apiConfiguration . openRouterModelId in routerModels . openrouter ,
67- } )
68-
6954 return (
7055 < >
7156 < VSCodeTextField
@@ -139,41 +124,6 @@ export const OpenRouter = ({
139124 organizationAllowList = { organizationAllowList }
140125 errorMessage = { modelValidationError }
141126 />
142- { openRouterModelProviders && Object . keys ( openRouterModelProviders ) . length > 0 && (
143- < div >
144- < div className = "flex items-center gap-1" >
145- < label className = "block font-medium mb-1" >
146- { t ( "settings:providers.openRouter.providerRouting.title" ) }
147- </ label >
148- < a href = { `https://openrouter.ai/${ selectedModelId } /providers` } >
149- < ExternalLinkIcon className = "w-4 h-4" />
150- </ a >
151- </ div >
152- < Select
153- value = { apiConfiguration ?. openRouterSpecificProvider || OPENROUTER_DEFAULT_PROVIDER_NAME }
154- onValueChange = { ( value ) => setApiConfigurationField ( "openRouterSpecificProvider" , value ) } >
155- < SelectTrigger className = "w-full" >
156- < SelectValue placeholder = { t ( "settings:common.select" ) } />
157- </ SelectTrigger >
158- < SelectContent >
159- < SelectItem value = { OPENROUTER_DEFAULT_PROVIDER_NAME } >
160- { OPENROUTER_DEFAULT_PROVIDER_NAME }
161- </ SelectItem >
162- { Object . entries ( openRouterModelProviders ) . map ( ( [ value , { label } ] ) => (
163- < SelectItem key = { value } value = { value } >
164- { label }
165- </ SelectItem >
166- ) ) }
167- </ SelectContent >
168- </ Select >
169- < div className = "text-sm text-vscode-descriptionForeground mt-1" >
170- { t ( "settings:providers.openRouter.providerRouting.description" ) } { " " }
171- < a href = "https://openrouter.ai/docs/features/provider-routing" >
172- { t ( "settings:providers.openRouter.providerRouting.learnMore" ) } .
173- </ a >
174- </ div >
175- </ div >
176- ) }
177127 </ >
178128 )
179129}
0 commit comments