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
|
if (!chat?.id) return null
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<div className="relative">
|
||||||
<Link
|
<div className="absolute left-2 top-1 flex h-6 w-6 items-center justify-center">
|
||||||
href={chat.path}
|
|
||||||
className={cn(
|
|
||||||
buttonVariants({ variant: 'ghost' }),
|
|
||||||
'group w-full px-2',
|
|
||||||
isActive && 'bg-accent'
|
|
||||||
)}
|
|
||||||
>
|
|
||||||
{chat.sharePath ? (
|
{chat.sharePath ? (
|
||||||
<Tooltip>
|
<Tooltip delayDuration={1000}>
|
||||||
<TooltipTrigger>
|
<TooltipTrigger
|
||||||
|
tabIndex={-1}
|
||||||
|
className="focus:bg-muted focus:ring-1 focus:ring-ring"
|
||||||
|
>
|
||||||
<IconUsers className="mr-2" />
|
<IconUsers className="mr-2" />
|
||||||
</TooltipTrigger>
|
</TooltipTrigger>
|
||||||
<TooltipContent>This is a shared chat.</TooltipContent>
|
<TooltipContent>This is a shared chat.</TooltipContent>
|
||||||
|
|
@ -44,14 +40,23 @@ export function SidebarItem({ chat, children }: SidebarItemProps) {
|
||||||
) : (
|
) : (
|
||||||
<IconMessage className="mr-2" />
|
<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
|
<div
|
||||||
className="relative max-h-5 flex-1 select-none overflow-hidden text-ellipsis break-all"
|
className="relative max-h-5 flex-1 select-none overflow-hidden text-ellipsis break-all"
|
||||||
title={chat.title}
|
title={chat.title}
|
||||||
>
|
>
|
||||||
<span className="whitespace-nowrap">{chat.title}</span>
|
<span className="whitespace-nowrap">{chat.title}</span>
|
||||||
</div>
|
</div>
|
||||||
{isActive && children}
|
|
||||||
</Link>
|
</Link>
|
||||||
</>
|
{isActive && <div className="absolute right-2 top-1">{children}</div>}
|
||||||
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue