Skip to content

Commit

Permalink
ui: support copy message content
Browse files Browse the repository at this point in the history
  • Loading branch information
634750802 committed May 14, 2024
1 parent 996ae9b commit 93d31dd
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 56 deletions.
8 changes: 7 additions & 1 deletion src/components/chat/message-operations.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useMyChatContext } from '@/components/chat/context';
import type { ConversationMessageGroupProps } from '@/components/chat/use-grouped-conversation-messages';
import { Button } from '@/components/ui/button';
import copy from 'copy-to-clipboard';
import { ClipboardIcon, RefreshCwIcon, ShareIcon, ThumbsDown } from 'lucide-react';

export function MessageOperations ({ group }: { group: ConversationMessageGroupProps }) {
Expand All @@ -27,7 +28,12 @@ export function MessageOperations ({ group }: { group: ConversationMessageGroupP
<ThumbsDown className="w-4 h-4" />
</Button>
<Button size="icon" variant="ghost" className="rounded-full w-7 h-7">
<ClipboardIcon className="w-4 h-4" />
<ClipboardIcon
className="w-4 h-4"
onClick={() => {
copy(group.assistantMessage.content);
}}
/>
</Button>
</div>
);
Expand Down
14 changes: 0 additions & 14 deletions src/components/message-list.tsx

This file was deleted.

41 changes: 0 additions & 41 deletions src/components/message.tsx

This file was deleted.

0 comments on commit 93d31dd

Please sign in to comment.