diff --git a/web/app/components/header/account-setting/sandbox-provider-page/config-modal.tsx b/web/app/components/header/account-setting/sandbox-provider-page/config-modal.tsx index 72445bbf80..35ffed5260 100644 --- a/web/app/components/header/account-setting/sandbox-provider-page/config-modal.tsx +++ b/web/app/components/header/account-setting/sandbox-provider-page/config-modal.tsx @@ -14,7 +14,7 @@ import { useDeleteSandboxProviderConfig, useSaveSandboxProviderConfig, } from '@/service/use-sandbox-provider' -import { PROVIDER_DOC_LINKS, SANDBOX_FIELD_CONFIGS } from './constants' +import { PROVIDER_DOC_LINKS, PROVIDER_LABEL_KEYS, SANDBOX_FIELD_CONFIGS } from './constants' import ProviderIcon from './provider-icon' type ConfigModalProps = { @@ -98,7 +98,9 @@ const ConfigModal = ({
- {provider.label} + + {t(PROVIDER_LABEL_KEYS[provider.provider_type as keyof typeof PROVIDER_LABEL_KEYS] ?? 'sandboxProvider.e2b.label', { ns: 'common' })} +
@@ -119,7 +121,7 @@ const ConfigModal = ({ rel="noopener noreferrer" className="system-xs-regular inline-flex items-center gap-1 text-text-accent hover:underline" > - {t('sandboxProvider.configModal.readDocLink', { ns: 'common', provider: provider.label })} + {t('sandboxProvider.configModal.readDocLink', { ns: 'common', provider: t(PROVIDER_LABEL_KEYS[provider.provider_type as keyof typeof PROVIDER_LABEL_KEYS] ?? 'sandboxProvider.e2b.label', { ns: 'common' }) })} )} diff --git a/web/app/components/header/account-setting/sandbox-provider-page/constants.ts b/web/app/components/header/account-setting/sandbox-provider-page/constants.ts index eefd98356d..a5d60aad88 100644 --- a/web/app/components/header/account-setting/sandbox-provider-page/constants.ts +++ b/web/app/components/header/account-setting/sandbox-provider-page/constants.ts @@ -7,6 +7,13 @@ export const PROVIDER_ICONS: Record = { local: '/sandbox-providers/local.svg', } +export const PROVIDER_LABEL_KEYS = { + e2b: 'sandboxProvider.e2b.label', + daytona: 'sandboxProvider.daytona.label', + docker: 'sandboxProvider.docker.label', + local: 'sandboxProvider.local.label', +} as const + export const PROVIDER_DESCRIPTION_KEYS = { e2b: 'sandboxProvider.e2b.description', daytona: 'sandboxProvider.daytona.description', diff --git a/web/app/components/header/account-setting/sandbox-provider-page/provider-card.tsx b/web/app/components/header/account-setting/sandbox-provider-page/provider-card.tsx index c1a529402f..fac890ef15 100644 --- a/web/app/components/header/account-setting/sandbox-provider-page/provider-card.tsx +++ b/web/app/components/header/account-setting/sandbox-provider-page/provider-card.tsx @@ -7,7 +7,7 @@ import { useTranslation } from 'react-i18next' import Button from '@/app/components/base/button' import Indicator from '@/app/components/header/indicator' import { cn } from '@/utils/classnames' -import { PROVIDER_DESCRIPTION_KEYS } from './constants' +import { PROVIDER_DESCRIPTION_KEYS, PROVIDER_LABEL_KEYS } from './constants' import ProviderIcon from './provider-icon' type ProviderCardProps = { @@ -45,7 +45,7 @@ const ProviderCard = ({
- {provider.label} + {t(PROVIDER_LABEL_KEYS[provider.provider_type as keyof typeof PROVIDER_LABEL_KEYS] ?? 'sandboxProvider.e2b.label', { ns: 'common' })} {provider.is_system_configured && !provider.is_tenant_configured && ( diff --git a/web/app/components/header/account-setting/sandbox-provider-page/switch-modal.tsx b/web/app/components/header/account-setting/sandbox-provider-page/switch-modal.tsx index d423dd9115..c15049b2e2 100644 --- a/web/app/components/header/account-setting/sandbox-provider-page/switch-modal.tsx +++ b/web/app/components/header/account-setting/sandbox-provider-page/switch-modal.tsx @@ -7,6 +7,7 @@ import Button from '@/app/components/base/button' import Modal from '@/app/components/base/modal' import { useToastContext } from '@/app/components/base/toast' import { useActivateSandboxProvider } from '@/service/use-sandbox-provider' +import { PROVIDER_LABEL_KEYS } from './constants' type SwitchModalProps = { provider: SandboxProvider @@ -57,7 +58,7 @@ const SwitchModal = ({ }} />
diff --git a/web/types/sandbox-provider.ts b/web/types/sandbox-provider.ts index 7c8478e2c9..178db2fba0 100644 --- a/web/types/sandbox-provider.ts +++ b/web/types/sandbox-provider.ts @@ -5,9 +5,6 @@ export type ConfigSchema = { export type SandboxProvider = { provider_type: string - label: string - description: string - icon: string is_system_configured: boolean is_tenant_configured: boolean is_active: boolean