import { useMemo } from "react"; import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import { buildFileTree } from "#/utils/file-tree"; import { TreeNode } from "./tree-node"; interface FileTreeViewProps { paths: string[]; selectedPath: string | null; onSelectFile: (path: string) => void; } export function FileTreeView({ paths, selectedPath, onSelectFile, }: FileTreeViewProps) { const { t } = useTranslation("openhands"); const root = useMemo(() => buildFileTree(paths), [paths]); if (root.children.length === 0) { return (
{t(I18nKey.FILES$NO_FILES)}
); } return ( ); }