-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Expand file tree
/
Copy pathUI.tsx
More file actions
33 lines (31 loc) · 1020 Bytes
/
Copy pathUI.tsx
File metadata and controls
33 lines (31 loc) · 1020 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import * as React from 'react';
import { Box, Text } from '@anthropic/ink';
import type { ToolProgressData } from 'src/Tool.js';
import type { ProgressMessage } from 'src/types/message.js';
import type { ThemeName } from 'src/utils/theme.js';
import type { Output } from './ExitWorktreeTool.js';
export function renderToolUseMessage(): React.ReactNode {
return 'Exiting worktree…';
}
export function renderToolResultMessage(
output: Output,
_progressMessagesForMessage: ProgressMessage<ToolProgressData>[],
_options: { theme: ThemeName },
): React.ReactNode {
if (!output) return null;
const actionLabel = output.action === 'keep' ? 'Kept worktree' : 'Removed worktree';
return (
<Box flexDirection="column">
<Text>
{actionLabel}
{output.worktreeBranch ? (
<>
{' '}
(branch <Text bold>{output.worktreeBranch}</Text>)
</>
) : null}
</Text>
<Text dimColor>Returned to {output.originalCwd}</Text>
</Box>
);
}