Skip to content

Commit

Permalink
ChatMessage: get timestamp out of direct view (#3948)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobitege authored Sep 19, 2024
1 parent 620526b commit 2842efa
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/components/chat/ChatMessage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ function ChatMessage({
}
};

const copyButtonTitle = message.timestamp
? `${t(I18nKey.CHAT_INTERFACE$TOOLTIP_COPY_MESSAGE)} - ${formatTimestamp(message.timestamp)}`
: t(I18nKey.CHAT_INTERFACE$TOOLTIP_COPY_MESSAGE);

return (
<article
data-testid="article"
Expand All @@ -78,7 +82,8 @@ function ChatMessage({
data-testid="copy-button"
onClick={copyToClipboard}
className="absolute top-1 right-1 p-1 bg-neutral-600 rounded hover:bg-neutral-700"
aria-label={t(I18nKey.CHAT_INTERFACE$TOOLTIP_COPY_MESSAGE)}
aria-label={copyButtonTitle}
title={copyButtonTitle}
type="button"
>
{isCopy ? <FaClipboardCheck /> : <FaClipboard />}
Expand All @@ -99,9 +104,6 @@ function ChatMessage({
))}
</div>
)}
<div className="text-xs text-neutral-400 mt-2">
{formatTimestamp(message.timestamp)}
</div>
{isLastMessage &&
message.sender === "assistant" &&
awaitingUserConfirmation && <ConfirmationButtons />}
Expand Down

0 comments on commit 2842efa

Please sign in to comment.