import type { ReactNode } 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;
};
export function TaskStatusText({ status, label, suffix }: TaskStatusTextProps): ReactNode {
const displayLabel = label ?? status;
const color =
status === 'completed' ? 'success' : status === 'failed' ? 'error' : status === 'killed' ? 'warning' : undefined;
return (
({displayLabel}
{suffix})
);
}
export function ShellProgress({ shell }: { shell: DeepImmutable }): ReactNode {
switch (shell.status) {
case 'completed':
return ;
case 'failed':
return ;
case 'killed':
return ;
case 'running':
case 'pending':
return ;
}
}