mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 14:25:51 +00:00
删除未使用的文件(BuiltinStatusLine.tsx、4 个重复的 .ts stub)、 移除约 55 个文件中未使用的 React 导入、 清理约 50 处未使用的导入/变量/参数。 净减少 ~296 行代码,precheck 4077 测试全部通过。 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
58 lines
1.8 KiB
TypeScript
58 lines
1.8 KiB
TypeScript
import { type ReactNode } from 'react';
|
|
import { Box, Byline, KeyboardShortcutHint } from '@anthropic/ink';
|
|
import { ConfigurableShortcutHint } from '../../../ConfigurableShortcutHint.js';
|
|
import { Select } from '../../../CustomSelect/select.js';
|
|
import { useWizard } from '../../../wizard/index.js';
|
|
import { WizardDialogLayout } from '../../../wizard/WizardDialogLayout.js';
|
|
import type { AgentWizardData } from '../types.js';
|
|
|
|
export function MethodStep(): ReactNode {
|
|
const { goNext, goBack, updateWizardData, goToStep } = useWizard<AgentWizardData>();
|
|
|
|
const methodOptions = [
|
|
{
|
|
label: 'Generate with Claude (recommended)',
|
|
value: 'generate',
|
|
},
|
|
{
|
|
label: 'Manual configuration',
|
|
value: 'manual',
|
|
},
|
|
];
|
|
|
|
return (
|
|
<WizardDialogLayout
|
|
subtitle="Creation method"
|
|
footerText={
|
|
<Byline>
|
|
<KeyboardShortcutHint shortcut="↑↓" action="navigate" />
|
|
<KeyboardShortcutHint shortcut="Enter" action="select" />
|
|
<ConfigurableShortcutHint action="confirm:no" context="Confirmation" fallback="Esc" description="go back" />
|
|
</Byline>
|
|
}
|
|
>
|
|
<Box>
|
|
<Select
|
|
key="method-select"
|
|
options={methodOptions}
|
|
onChange={(value: string) => {
|
|
const method = value as 'generate' | 'manual';
|
|
updateWizardData({
|
|
method,
|
|
wasGenerated: method === 'generate',
|
|
});
|
|
|
|
// Dynamic navigation based on method
|
|
if (method === 'generate') {
|
|
goNext(); // Go to GenerateStep (index 2)
|
|
} else {
|
|
goToStep(3); // Skip to TypeStep (index 3)
|
|
}
|
|
}}
|
|
onCancel={() => goBack()}
|
|
/>
|
|
</Box>
|
|
</WizardDialogLayout>
|
|
);
|
|
}
|