mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 06:15:51 +00:00
style: 完成所有文件的lint
This commit is contained in:
@@ -1,52 +1,38 @@
|
||||
import type { ReactNode } from 'react'
|
||||
import React from 'react'
|
||||
import { Text } from '@anthropic/ink'
|
||||
import type { TaskStatus } from 'src/Task.js'
|
||||
import type { LocalShellTaskState } from 'src/tasks/LocalShellTask/guards.js'
|
||||
import type { DeepImmutable } from 'src/types/utils.js'
|
||||
import type { ReactNode } from 'react';
|
||||
import React from 'react';
|
||||
import { Text } from '@anthropic/ink';
|
||||
import type { TaskStatus } from 'src/Task.js';
|
||||
import type { LocalShellTaskState } from 'src/tasks/LocalShellTask/guards.js';
|
||||
import type { DeepImmutable } from 'src/types/utils.js';
|
||||
|
||||
type TaskStatusTextProps = {
|
||||
status: TaskStatus
|
||||
label?: string
|
||||
suffix?: string
|
||||
}
|
||||
status: TaskStatus;
|
||||
label?: string;
|
||||
suffix?: string;
|
||||
};
|
||||
|
||||
export function TaskStatusText({
|
||||
status,
|
||||
label,
|
||||
suffix,
|
||||
}: TaskStatusTextProps): ReactNode {
|
||||
const displayLabel = label ?? status
|
||||
export function TaskStatusText({ status, label, suffix }: TaskStatusTextProps): ReactNode {
|
||||
const displayLabel = label ?? status;
|
||||
const color =
|
||||
status === 'completed'
|
||||
? 'success'
|
||||
: status === 'failed'
|
||||
? 'error'
|
||||
: status === 'killed'
|
||||
? 'warning'
|
||||
: undefined
|
||||
status === 'completed' ? 'success' : status === 'failed' ? 'error' : status === 'killed' ? 'warning' : undefined;
|
||||
return (
|
||||
<Text color={color} dimColor>
|
||||
({displayLabel}
|
||||
{suffix})
|
||||
</Text>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export function ShellProgress({
|
||||
shell,
|
||||
}: {
|
||||
shell: DeepImmutable<LocalShellTaskState>
|
||||
}): ReactNode {
|
||||
export function ShellProgress({ shell }: { shell: DeepImmutable<LocalShellTaskState> }): ReactNode {
|
||||
switch (shell.status) {
|
||||
case 'completed':
|
||||
return <TaskStatusText status="completed" label="done" />
|
||||
return <TaskStatusText status="completed" label="done" />;
|
||||
case 'failed':
|
||||
return <TaskStatusText status="failed" label="error" />
|
||||
return <TaskStatusText status="failed" label="error" />;
|
||||
case 'killed':
|
||||
return <TaskStatusText status="killed" label="stopped" />
|
||||
return <TaskStatusText status="killed" label="stopped" />;
|
||||
case 'running':
|
||||
case 'pending':
|
||||
return <TaskStatusText status="running" />
|
||||
return <TaskStatusText status="running" />;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user