Skip to content

Commit 84d6008

Browse files
authored
fix: add an indicator for nested pages in search (#147)
1 parent be3d7d8 commit 84d6008

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/components/command-menu.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react'
22
import { useNavigate } from '@tanstack/react-router'
33
import {
44
IconArrowRightDashed,
5+
IconChevronRight,
56
IconDeviceLaptop,
67
IconMoon,
78
IconSun,
@@ -60,16 +61,16 @@ export function CommandMenu() {
6061

6162
return navItem.items?.map((subItem, i) => (
6263
<CommandItem
63-
key={`${subItem.url}-${i}`}
64-
value={subItem.title}
64+
key={`${navItem.title}-${subItem.url}-${i}`}
65+
value={`${navItem.title}-${subItem.url}`}
6566
onSelect={() => {
6667
runCommand(() => navigate({ to: subItem.url }))
6768
}}
6869
>
6970
<div className='mr-2 flex h-4 w-4 items-center justify-center'>
7071
<IconArrowRightDashed className='text-muted-foreground/80 size-2' />
7172
</div>
72-
{subItem.title}
73+
{navItem.title} <IconChevronRight /> {subItem.title}
7374
</CommandItem>
7475
))
7576
})}

0 commit comments

Comments
 (0)