fix(sandbox-provider): update switch modal warning style to match design

Replace yellow warning box with red text for destructive emphasis.
Bold the provider name in confirmation text using Trans component.
This commit is contained in:
yyh 2026-01-13 13:23:03 +08:00
parent 99273e1118
commit 3042f29c15
No known key found for this signature in database
3 changed files with 14 additions and 15 deletions

View File

@ -1,9 +1,8 @@
'use client'
import type { SandboxProvider } from '@/service/use-sandbox-provider'
import { RiAlertLine } from '@remixicon/react'
import { memo, useCallback } from 'react'
import { useTranslation } from 'react-i18next'
import { Trans, useTranslation } from 'react-i18next'
import Button from '@/app/components/base/button'
import Modal from '@/app/components/base/modal'
import { useToastContext } from '@/app/components/base/toast'
@ -49,23 +48,23 @@ const SwitchModal = ({
>
<div className="mt-4">
{/* Warning Section */}
<div className="flex gap-3 rounded-xl bg-state-warning-hover p-3">
<div className="flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-state-warning-solid">
<RiAlertLine className="h-3 w-3 text-text-warning-secondary" />
<div>
<div className="system-sm-semibold text-text-destructive">
{t('sandboxProvider.switchModal.warning', { ns: 'common' })}
</div>
<div>
<div className="system-sm-semibold text-text-primary">
{t('sandboxProvider.switchModal.warning', { ns: 'common' })}
</div>
<div className="system-xs-regular mt-1 text-text-secondary">
{t('sandboxProvider.switchModal.warningDesc', { ns: 'common' })}
</div>
<div className="system-xs-regular mt-0.5 text-text-destructive">
{t('sandboxProvider.switchModal.warningDesc', { ns: 'common' })}
</div>
</div>
{/* Confirm Text */}
<div className="system-sm-regular mt-4 text-text-secondary">
{t('sandboxProvider.switchModal.confirmText', { ns: 'common', provider: provider.label })}
<Trans
i18nKey="sandboxProvider.switchModal.confirmText"
ns="common"
values={{ provider: provider.label }}
components={{ bold: <span className="system-sm-semibold" /> }}
/>
</div>
{/* Footer Actions */}

View File

@ -595,7 +595,7 @@
"sandboxProvider.setAsActive": "Set as Active",
"sandboxProvider.switchModal.cancel": "Cancel",
"sandboxProvider.switchModal.confirm": "Switch",
"sandboxProvider.switchModal.confirmText": "You are about to switch the active sandbox provider to {{provider}}.",
"sandboxProvider.switchModal.confirmText": "You are about to switch the active sandbox provider to <bold>{{provider}}</bold>.",
"sandboxProvider.switchModal.title": "Switch Active Provider?",
"sandboxProvider.switchModal.warning": "Impact on running agents",
"sandboxProvider.switchModal.warningDesc": "Switching the provider will affect all newly started agent tasks. Currently running sessions might be interrupted.",

View File

@ -593,7 +593,7 @@
"sandboxProvider.setAsActive": "设为激活",
"sandboxProvider.switchModal.cancel": "取消",
"sandboxProvider.switchModal.confirm": "切换",
"sandboxProvider.switchModal.confirmText": "您即将将活动沙箱供应商切换为 {{provider}}。",
"sandboxProvider.switchModal.confirmText": "您即将将活动沙箱供应商切换为 <bold>{{provider}}</bold>。",
"sandboxProvider.switchModal.title": "切换活动供应商?",
"sandboxProvider.switchModal.warning": "对运行中的代理的影响",
"sandboxProvider.switchModal.warningDesc": "切换供应商将影响所有新启动的代理任务。当前运行的会话可能会被中断。",