/** * @license * Copyright 2025 Qwen * SPDX-License-Identifier: Apache-2.0 */ import { Box, Text } from 'ink'; import { RadioButtonSelect } from '../../shared/RadioButtonSelect.js'; import { type Extension } from '@qwen-code/qwen-code-core'; import { theme } from '../../../semantic-colors.js'; import { t } from '../../../../i18n/index.js'; interface ScopeSelectStepProps { selectedExtension: Extension | null; mode: 'disable' | 'enable'; onScopeSelect: (scope: 'user' | 'workspace') => void; } export function ScopeSelectStep({ selectedExtension, mode, onScopeSelect, }: ScopeSelectStepProps) { const scopeItems = [ { key: 'user', get label() { return t('User (global)'); }, value: 'user' as const, }, { key: 'workspace', get label() { return t('Workspace (project-specific)'); }, value: 'workspace' as const, }, ]; const handleSelect = (value: 'user' | 'workspace') => { onScopeSelect(value); }; if (!selectedExtension) { return ( {t('No extension selected')} ); } const title = mode === 'disable' ? t('Disable "{{name}}" - Select Scope', { name: selectedExtension.name }) : t('Enable "{{name}}" - Select Scope', { name: selectedExtension.name }); return ( {title} ); }