Skip to content

Commit

Permalink
feat(ChatDraft): position add to draft button
Browse files Browse the repository at this point in the history
  • Loading branch information
ArslanSaleem committed Oct 29, 2024
1 parent 7b7e0df commit fd6c50b
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions frontend/src/components/ui/ChatBubble.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,19 +132,6 @@ const ChatBubble: React.FC<ChatBubbleProps> = ({
return (
<div className="flex flex-col max-w-2xl">
<ChatBubbleWrapper sender={sender}>
{/* Add to draft button for chat */}
{sender == "bot" && onAddToDraft && (
<div className="w-full flex justify-end">
<TooltipWrapper content={"Add to draft"}>
<FilePenLine
width={18}
className="hover:cursor-pointer"
onClick={onAddToDraft}
/>
</TooltipWrapper>
</div>
)}

{references && references.length > 0 ? (
<MessageWithReferences
message={message}
Expand All @@ -157,9 +144,25 @@ const ChatBubble: React.FC<ChatBubbleProps> = ({
{markify_text(message)}
</ReactMarkdown>
)}
<div className="text-xs text-gray-500 mt-2 text-right">
{timestamp.toLocaleTimeString()}
</div>
{/* Add to draft button for chat */}
{sender == "bot" && onAddToDraft ? (
<div className="w-full flex justify-between">
<div className="text-xs text-gray-500 mt-2 text-right">
{timestamp.toLocaleTimeString()}
</div>
<TooltipWrapper content={"Add to draft"}>
<FilePenLine
width={18}
className="hover:cursor-pointer"
onClick={onAddToDraft}
/>
</TooltipWrapper>
</div>
) : (
<div className="text-xs text-gray-500 mt-2 text-left">
{timestamp.toLocaleTimeString()}
</div>
)}
</ChatBubbleWrapper>

{references && references.length > 0 && (
Expand Down

0 comments on commit fd6c50b

Please sign in to comment.