fix: update sidebar item
This commit is contained in:
parent
477dc20222
commit
33f2fabe72
1 changed files with 18 additions and 13 deletions
|
|
@ -25,18 +25,14 @@ export function SidebarItem({ chat, children }: SidebarItemProps) {
|
|||
if (!chat?.id) return null
|
||||
|
||||
return (
|
||||
<>
|
||||
<Link
|
||||
href={chat.path}
|
||||
className={cn(
|
||||
buttonVariants({ variant: 'ghost' }),
|
||||
'group w-full px-2',
|
||||
isActive && 'bg-accent'
|
||||
)}
|
||||
>
|
||||
<div className="relative">
|
||||
<div className="absolute left-2 top-1 flex h-6 w-6 items-center justify-center">
|
||||
{chat.sharePath ? (
|
||||
<Tooltip>
|
||||
<TooltipTrigger>
|
||||
<Tooltip delayDuration={1000}>
|
||||
<TooltipTrigger
|
||||
tabIndex={-1}
|
||||
className="focus:bg-muted focus:ring-1 focus:ring-ring"
|
||||
>
|
||||
<IconUsers className="mr-2" />
|
||||
</TooltipTrigger>
|
||||
<TooltipContent>This is a shared chat.</TooltipContent>
|
||||
|
|
@ -44,14 +40,23 @@ export function SidebarItem({ chat, children }: SidebarItemProps) {
|
|||
) : (
|
||||
<IconMessage className="mr-2" />
|
||||
)}
|
||||
</div>
|
||||
<Link
|
||||
href={chat.path}
|
||||
className={cn(
|
||||
buttonVariants({ variant: 'ghost' }),
|
||||
'group w-full pl-8 pr-16',
|
||||
isActive && 'bg-accent'
|
||||
)}
|
||||
>
|
||||
<div
|
||||
className="relative max-h-5 flex-1 select-none overflow-hidden text-ellipsis break-all"
|
||||
title={chat.title}
|
||||
>
|
||||
<span className="whitespace-nowrap">{chat.title}</span>
|
||||
</div>
|
||||
{isActive && children}
|
||||
</Link>
|
||||
</>
|
||||
{isActive && <div className="absolute right-2 top-1">{children}</div>}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue