mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-21 15:55:50 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,32 +1,26 @@
|
||||
import figures from 'figures'
|
||||
import React, { useState } from 'react'
|
||||
import { Box, Text } from '@anthropic/ink'
|
||||
import { useKeybinding } from '../keybindings/useKeybinding.js'
|
||||
import TextInput from './TextInput.js'
|
||||
import figures from 'figures';
|
||||
import React, { useState } from 'react';
|
||||
import { Box, Text } from '@anthropic/ink';
|
||||
import { useKeybinding } from '../keybindings/useKeybinding.js';
|
||||
import TextInput from './TextInput.js';
|
||||
|
||||
type Props = {
|
||||
initialLanguage: string | undefined
|
||||
onComplete: (language: string | undefined) => void
|
||||
onCancel: () => void
|
||||
}
|
||||
initialLanguage: string | undefined;
|
||||
onComplete: (language: string | undefined) => void;
|
||||
onCancel: () => void;
|
||||
};
|
||||
|
||||
export function LanguagePicker({
|
||||
initialLanguage,
|
||||
onComplete,
|
||||
onCancel,
|
||||
}: Props): React.ReactNode {
|
||||
const [language, setLanguage] = useState(initialLanguage)
|
||||
const [cursorOffset, setCursorOffset] = useState(
|
||||
(initialLanguage ?? '').length,
|
||||
)
|
||||
export function LanguagePicker({ initialLanguage, onComplete, onCancel }: Props): React.ReactNode {
|
||||
const [language, setLanguage] = useState(initialLanguage);
|
||||
const [cursorOffset, setCursorOffset] = useState((initialLanguage ?? '').length);
|
||||
|
||||
// Use configurable keybinding for ESC to cancel
|
||||
// Use Settings context so 'n' key doesn't trigger cancel (allows typing 'n' in input)
|
||||
useKeybinding('confirm:no', onCancel, { context: 'Settings' })
|
||||
useKeybinding('confirm:no', onCancel, { context: 'Settings' });
|
||||
|
||||
function handleSubmit(): void {
|
||||
const trimmed = language?.trim()
|
||||
onComplete(trimmed || undefined)
|
||||
const trimmed = language?.trim();
|
||||
onComplete(trimmed || undefined);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -48,5 +42,5 @@ export function LanguagePicker({
|
||||
</Box>
|
||||
<Text dimColor>Leave empty for default (English)</Text>
|
||||
</Box>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user