-
Notifications
You must be signed in to change notification settings - Fork 16.5k
Expand file tree
/
Copy pathUI.tsx
More file actions
32 lines (30 loc) · 932 Bytes
/
Copy pathUI.tsx
File metadata and controls
32 lines (30 loc) · 932 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
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 './EnterWorktreeTool.js';
export function renderToolUseMessage(): React.ReactNode {
return 'Creating worktree…';
}
export function renderToolResultMessage(
output: Output,
_progressMessagesForMessage: ProgressMessage<ToolProgressData>[],
_options: { theme: ThemeName },
): React.ReactNode {
if (!output) return null;
return (
<Box flexDirection="column">
<Text>
Switched to worktree
{output.worktreeBranch ? (
<>
{' '}
on branch <Text bold>{output.worktreeBranch}</Text>
</>
) : null}
</Text>
<Text dimColor>{output.worktreePath}</Text>
</Box>
);
}