Skip to content

Commit

Permalink
enhancement: move token speed to bottom
Browse files Browse the repository at this point in the history
  • Loading branch information
urmauur committed Dec 16, 2024
1 parent 707c23f commit 9f8a0cf
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions web/screens/Thread/ThreadCenterPanel/TextMessage/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -80,24 +80,27 @@ const MessageContainer: React.FC<
<p className="text-xs font-medium text-gray-400">
{displayDate(props.created)}
</p>
{tokenSpeed &&
tokenSpeed.message === props.id &&
tokenSpeed.tokenSpeed > 0 && (
<p className="absolute right-8 text-xs font-medium text-[hsla(var(--text-secondary))]">
Token Speed: {Number(tokenSpeed.tokenSpeed).toFixed(2)}t/s
</p>
)}
</div>

<div className="flex w-full flex-col">
<div className="flex w-full flex-col ">
<div
className={twMerge(
'absolute right-0 order-1 mt-2 flex cursor-pointer items-center justify-start gap-x-2 transition-all',
props.isCurrentMessage && !isUser
? 'relative order-2 flex justify-end'
? 'relative left-0 order-2 flex w-full justify-between'
: 'hidden group-hover:absolute group-hover:right-4 group-hover:top-4 group-hover:flex'
)}
>
<div>
{tokenSpeed &&
tokenSpeed.message === props.id &&
tokenSpeed.tokenSpeed > 0 && (
<p className="text-xs font-medium text-[hsla(var(--text-secondary))]">
Token Speed: {Number(tokenSpeed.tokenSpeed).toFixed(2)}t/s
</p>
)}
</div>

<MessageToolbar message={props} />
</div>
<div
Expand Down

0 comments on commit 9f8a0cf

Please sign in to comment.