Skip to content

Commit 3ae1ada

Browse files
koki-developclaude
andcommitted
feat: Update MessageItem to use EditAction component
- Refactor MessageItem to use new EditAction component - Reorder display: show EditAction before cat message - Remove duplicate diff formatting logic - Improve component separation and reusability 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent 64bc1a3 commit 3ae1ada

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/MessageItem.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { Box, Text } from "ink";
22
import type React from "react";
33
import { indent } from "../lib/util";
4+
import { EditAction } from "./EditAction";
45
import type { Message } from "./types";
56

67
interface MessageItemProps {
@@ -11,7 +12,10 @@ export const MessageItem: React.FC<MessageItemProps> = ({ message }) => {
1112
const isUser = message.sender === "user";
1213

1314
return (
14-
<Box marginBottom={1} paddingLeft={1}>
15+
<Box flexDirection="column" marginBottom={1} paddingLeft={1}>
16+
{!isUser && message.action?.type === "edit" && (
17+
<EditAction action={message.action} />
18+
)}
1519
<Text color={isUser ? "gray" : undefined}>
1620
{isUser ? `> ${indent(message.text)}` : `⏺ ${indent(message.text)}`}
1721
</Text>

0 commit comments

Comments
 (0)