mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,33 +1,29 @@
|
||||
import sample from 'lodash-es/sample.js'
|
||||
import React from 'react'
|
||||
import { gracefulShutdown } from '../utils/gracefulShutdown.js'
|
||||
import { WorktreeExitDialog } from './WorktreeExitDialog.js'
|
||||
import sample from 'lodash-es/sample.js';
|
||||
import React from 'react';
|
||||
import { gracefulShutdown } from '../utils/gracefulShutdown.js';
|
||||
import { WorktreeExitDialog } from './WorktreeExitDialog.js';
|
||||
|
||||
const GOODBYE_MESSAGES = ['Goodbye!', 'See ya!', 'Bye!', 'Catch you later!']
|
||||
const GOODBYE_MESSAGES = ['Goodbye!', 'See ya!', 'Bye!', 'Catch you later!'];
|
||||
|
||||
function getRandomGoodbyeMessage(): string {
|
||||
return sample(GOODBYE_MESSAGES) ?? 'Goodbye!'
|
||||
return sample(GOODBYE_MESSAGES) ?? 'Goodbye!';
|
||||
}
|
||||
|
||||
type Props = {
|
||||
onDone: (message?: string) => void
|
||||
onCancel?: () => void
|
||||
showWorktree: boolean
|
||||
}
|
||||
onDone: (message?: string) => void;
|
||||
onCancel?: () => void;
|
||||
showWorktree: boolean;
|
||||
};
|
||||
|
||||
export function ExitFlow({
|
||||
showWorktree,
|
||||
onDone,
|
||||
onCancel,
|
||||
}: Props): React.ReactNode {
|
||||
export function ExitFlow({ showWorktree, onDone, onCancel }: Props): React.ReactNode {
|
||||
async function onExit(resultMessage?: string) {
|
||||
onDone(resultMessage ?? getRandomGoodbyeMessage())
|
||||
await gracefulShutdown(0, 'prompt_input_exit')
|
||||
onDone(resultMessage ?? getRandomGoodbyeMessage());
|
||||
await gracefulShutdown(0, 'prompt_input_exit');
|
||||
}
|
||||
|
||||
if (showWorktree) {
|
||||
return <WorktreeExitDialog onDone={onExit} onCancel={onCancel} />
|
||||
return <WorktreeExitDialog onDone={onExit} onCancel={onCancel} />;
|
||||
}
|
||||
|
||||
return null
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user