mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-06-29 23:41:12 +08:00
Fix username line break in SharedBadge component (#13794)
## Summary - Added Tailwind truncation classes (`inline-block max-w-[120px] truncate align-middle`) to the username `<span>` in `SharedBadge` to prevent long usernames from wrapping onto multiple lines - Added `title` attribute to show the full username on hover when truncated  ## Test plan - [x] Verify long usernames display truncated with ellipsis (`...`) - [x] Verify hovering over a truncated username shows the full name as a tooltip - [x] Verify short usernames display normally without truncation Closes #13748
This commit is contained in:
@@ -8,5 +8,12 @@ export function SharedBadge({ children }: PropsWithChildren) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <span className="bg-bg-card rounded-sm px-1 text-xs inline-block max-w-[120px] truncate align-middle">{children}</span>;
|
||||
return (
|
||||
<span
|
||||
title={typeof children === 'string' ? children : undefined}
|
||||
className="inline-block max-w-[120px] truncate align-middle bg-bg-card rounded-sm px-1 text-xs"
|
||||
>
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user