Skip to content

Commit 5090899

Browse files
feat: add file count badge to tree item
1 parent 1010a56 commit 5090899

File tree

1 file changed

+3
-1
lines changed
  • src/webview/SearchSidebar/SearchResultList/comps

1 file changed

+3
-1
lines changed

src/webview/SearchSidebar/SearchResultList/comps/TreeItem.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { useBoolean } from 'react-use'
44
import type { SgSearch } from '../../../../types'
55
import { CodeBlock } from './CodeBlock'
66
import { FileLink } from './FileLink'
7+
import { VSCodeBadge } from '@vscode/webview-ui-toolkit/react'
78

89
interface TreeItemProps {
910
filePath: string
@@ -39,11 +40,12 @@ const TreeItem = ({ filePath, matches }: TreeItemProps) => {
3940
gap="4"
4041
px="2"
4142
alignItems="center"
43+
justifyContent="space-between"
4244
h="22px"
4345
lineHeight="22px"
4446
>
4547
<FileLink filePath={filePath} />
46-
<div>{matches.length.toString()}</div>
48+
<VSCodeBadge>{matches.length}</VSCodeBadge>
4749
</HStack>
4850
</HStack>
4951

0 commit comments

Comments
 (0)