Skip to content

Commit 4736894

Browse files
committed
Remove unused imports and defs since using ApiKey component
Signed-off-by: Geoff Wilson <[email protected]>
1 parent 5ec88ba commit 4736894

File tree

13 files changed

+3
-132
lines changed

13 files changed

+3
-132
lines changed

webview-ui/src/components/settings/providers/Cerebras.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { useCallback } from "react"
2-
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
3-
41
import type { ProviderSettings } from "@roo-code/types"
52
import { API_KEYS } from "@roo-code/types"
63

74
import { useAppTranslation } from "@src/i18n/TranslationContext"
85

9-
import { inputEventTransform } from "../transforms"
106
import { ApiKey } from "../ApiKey"
117

128
type CerebrasProps = {
@@ -17,16 +13,6 @@ type CerebrasProps = {
1713
export const Cerebras = ({ apiConfiguration, setApiConfigurationField }: CerebrasProps) => {
1814
const { t } = useAppTranslation()
1915

20-
const handleInputChange = useCallback(
21-
<K extends keyof ProviderSettings, E>(
22-
field: K,
23-
transform: (event: E) => ProviderSettings[K] = inputEventTransform,
24-
) =>
25-
(event: E | Event) => {
26-
setApiConfigurationField(field, transform(event as E))
27-
},
28-
[setApiConfigurationField],
29-
)
3016

3117
return (
3218
<>

webview-ui/src/components/settings/providers/DeepInfra.tsx

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { useCallback, useEffect, useState } from "react"
2-
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
1+
import { useEffect, useState } from "react"
32

43
import { OrganizationAllowList, type ProviderSettings, deepInfraDefaultModelId, API_KEYS } from "@roo-code/types"
54

@@ -9,7 +8,6 @@ import { vscode } from "@src/utils/vscode"
98
import { useAppTranslation } from "@src/i18n/TranslationContext"
109
import { Button } from "@src/components/ui"
1110

12-
import { inputEventTransform } from "../transforms"
1311
import { ModelPicker } from "../ModelPicker"
1412
import { ApiKey } from "../ApiKey"
1513

@@ -34,16 +32,6 @@ export const DeepInfra = ({
3432

3533
const [didRefetch, setDidRefetch] = useState<boolean>()
3634

37-
const handleInputChange = useCallback(
38-
<K extends keyof ProviderSettings, E>(
39-
field: K,
40-
transform: (event: E) => ProviderSettings[K] = inputEventTransform,
41-
) =>
42-
(event: E | Event) => {
43-
setApiConfigurationField(field, transform(event as E))
44-
},
45-
[setApiConfigurationField],
46-
)
4735

4836
useEffect(() => {
4937
// When base URL or API key changes, trigger a silent refresh of models

webview-ui/src/components/settings/providers/Doubao.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { useCallback } from "react"
2-
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
3-
41
import type { ProviderSettings } from "@roo-code/types"
52
import { API_KEYS } from "@roo-code/types"
63

74
import { useAppTranslation } from "@src/i18n/TranslationContext"
85

9-
import { inputEventTransform } from "../transforms"
106
import { ApiKey } from "../ApiKey"
117

128
type DoubaoProps = {
@@ -17,16 +13,6 @@ type DoubaoProps = {
1713
export const Doubao = ({ apiConfiguration, setApiConfigurationField }: DoubaoProps) => {
1814
const { t } = useAppTranslation()
1915

20-
const handleInputChange = useCallback(
21-
<K extends keyof ProviderSettings, E>(
22-
field: K,
23-
transform: (event: E) => ProviderSettings[K] = inputEventTransform,
24-
) =>
25-
(event: E | Event) => {
26-
setApiConfigurationField(field, transform(event as E))
27-
},
28-
[setApiConfigurationField],
29-
)
3016

3117
return (
3218
<>

webview-ui/src/components/settings/providers/Featherless.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { useCallback } from "react"
2-
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
3-
41
import type { ProviderSettings } from "@roo-code/types"
52
import { API_KEYS } from "@roo-code/types"
63

74
import { useAppTranslation } from "@src/i18n/TranslationContext"
85

9-
import { inputEventTransform } from "../transforms"
106
import { ApiKey } from "../ApiKey"
117

128
type FeatherlessProps = {
@@ -17,16 +13,6 @@ type FeatherlessProps = {
1713
export const Featherless = ({ apiConfiguration, setApiConfigurationField }: FeatherlessProps) => {
1814
const { t } = useAppTranslation()
1915

20-
const handleInputChange = useCallback(
21-
<K extends keyof ProviderSettings, E>(
22-
field: K,
23-
transform: (event: E) => ProviderSettings[K] = inputEventTransform,
24-
) =>
25-
(event: E | Event) => {
26-
setApiConfigurationField(field, transform(event as E))
27-
},
28-
[setApiConfigurationField],
29-
)
3016

3117
return (
3218
<>

webview-ui/src/components/settings/providers/Fireworks.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
1-
import { useCallback } from "react"
2-
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
3-
41
import type { ProviderSettings } from "@roo-code/types"
52
import { API_KEYS } from "@roo-code/types"
63

74
import { useAppTranslation } from "@src/i18n/TranslationContext"
85

9-
import { inputEventTransform } from "../transforms"
106
import { ApiKey } from "../ApiKey"
117

128
type FireworksProps = {
@@ -17,16 +13,6 @@ type FireworksProps = {
1713
export const Fireworks = ({ apiConfiguration, setApiConfigurationField }: FireworksProps) => {
1814
const { t } = useAppTranslation()
1915

20-
const handleInputChange = useCallback(
21-
<K extends keyof ProviderSettings, E>(
22-
field: K,
23-
transform: (event: E) => ProviderSettings[K] = inputEventTransform,
24-
) =>
25-
(event: E | Event) => {
26-
setApiConfigurationField(field, transform(event as E))
27-
},
28-
[setApiConfigurationField],
29-
)
3016

3117
return (
3218
<>

webview-ui/src/components/settings/providers/HuggingFace.tsx

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
import { useCallback, useState, useEffect, useMemo } from "react"
22
import { useEvent } from "react-use"
3-
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
43

54
import type { ProviderSettings } from "@roo-code/types"
65
import { API_KEYS } from "@roo-code/types"
76

87
import { ExtensionMessage } from "@roo/ExtensionMessage"
98
import { vscode } from "@src/utils/vscode"
109
import { useAppTranslation } from "@src/i18n/TranslationContext"
11-
import { VSCodeButtonLink } from "@src/components/common/VSCodeButtonLink"
1210
import { SearchableSelect, type SearchableSelectOption } from "@src/components/ui"
1311
import { cn } from "@src/lib/utils"
1412
import { formatPrice } from "@/utils/formatPrice"
1513

16-
import { inputEventTransform } from "../transforms"
1714
import { ApiKey } from "../ApiKey"
1815

1916
type HuggingFaceModel = {
@@ -51,16 +48,6 @@ export const HuggingFace = ({ apiConfiguration, setApiConfigurationField }: Hugg
5148
apiConfiguration?.huggingFaceInferenceProvider || "auto",
5249
)
5350

54-
const handleInputChange = useCallback(
55-
<K extends keyof ProviderSettings, E>(
56-
field: K,
57-
transform: (event: E) => ProviderSettings[K] = inputEventTransform,
58-
) =>
59-
(event: E | Event) => {
60-
setApiConfigurationField(field, transform(event as E))
61-
},
62-
[setApiConfigurationField],
63-
)
6451

6552
// Fetch models when component mounts.
6653
useEffect(() => {

webview-ui/src/components/settings/providers/IOIntelligence.tsx

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
import { useCallback } from "react"
2-
import { VSCodeTextField } from "@vscode/webview-ui-toolkit/react"
3-
41
import {
52
type ProviderSettings,
63
type OrganizationAllowList,
@@ -10,12 +7,9 @@ import {
107
} from "@roo-code/types"
118

129
import { useAppTranslation } from "@src/i18n/TranslationContext"
13-
import { VSCodeButtonLink } from "@src/components/common/VSCodeButtonLink"
1410
import { useExtensionState } from "@src/context/ExtensionStateContext"
1511

1612
import { ModelPicker } from "../ModelPicker"
17-
18-
import { inputEventTransform } from "../transforms"
1913
import { ApiKey } from "../ApiKey"
2014

2115
type IOIntelligenceProps = {
@@ -34,16 +28,6 @@ export const IOIntelligence = ({
3428
const { t } = useAppTranslation()
3529
const { routerModels } = useExtensionState()
3630

37-
const handleInputChange = useCallback(
38-
<K extends keyof ProviderSettings, E>(
39-
field: K,
40-
transform: (event: E) => ProviderSettings[K] = inputEventTransform,
41-
) =>
42-
(event: E | Event) => {
43-
setApiConfigurationField(field, transform(event as E))
44-
},
45-
[setApiConfigurationField],
46-
)
4731

4832
return (
4933
<>

webview-ui/src/components/settings/providers/Moonshot.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useCallback } from "react"
2-
import { VSCodeTextField, VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react"
2+
import { VSCodeDropdown, VSCodeOption } from "@vscode/webview-ui-toolkit/react"
33

44
import type { ProviderSettings } from "@roo-code/types"
55
import { API_KEYS } from "@roo-code/types"

webview-ui/src/components/settings/providers/OpenAI.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import type { ModelInfo, ProviderSettings } from "@roo-code/types"
66
import { API_KEYS } from "@roo-code/types"
77

88
import { useAppTranslation } from "@src/i18n/TranslationContext"
9-
import { VSCodeButtonLink } from "@src/components/common/VSCodeButtonLink"
109
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, StandardTooltip } from "@src/components/ui"
1110

1211
import { inputEventTransform } from "../transforms"

webview-ui/src/components/settings/providers/Requesty.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ export const Requesty = ({
3737
}: RequestyProps) => {
3838
const { t } = useAppTranslation()
3939

40-
const [didRefetch, setDidRefetch] = useState<boolean>()
4140
const [requestyEndpointSelected, setRequestyEndpointSelected] = useState(!!apiConfiguration.requestyBaseUrl)
4241

4342
// This ensures that the "Use custom URL" checkbox is hidden when the user deletes the URL.

0 commit comments

Comments
 (0)