Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions packages/ui/src/components/file-explorer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,16 +108,17 @@ function FolderItem({ children, value = '', isActive, content, link, level }: Fo
)
}

interface FileItemProps {
type FileItemProps = {
level: number
children: ReactNode
isActive?: boolean
link?: string
onClick?: () => void
tooltip?: TooltipProps['content']
[key: `data-${string}`]: any
}

function FileItem({ children, isActive, level, link, onClick, tooltip }: FileItemProps) {
function FileItem({ children, isActive, level, link, onClick, tooltip, ...dataProps }: FileItemProps) {
const comp = (
<Item
icon="empty-page"
Expand All @@ -126,6 +127,7 @@ function FileItem({ children, isActive, level, link, onClick, tooltip }: FileIte
style={{ marginLeft: `calc(-16px * ${level})`, paddingLeft: level ? `calc(16px * ${level} + 8px)` : '24px' }}
onClick={onClick}
link={link}
{...dataProps}
>
{children}
</Item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,8 +359,9 @@ function renderTree(
)}
</Layout.Flex>
}
data-explorer-path={node.path}
>
<div data-explorer-path={node.path}>{node.name}</div>
{node.name}
</FileExplorer.FileItem>
)
}
Expand Down