gbclient/app/tree/page.tsx

26 lines
821 B
TypeScript

"use client";
import { useState } from 'react';
import { FileTree } from './components/FileTree';
import { FileBrowser } from './components/FileBrowser';
import { FileOperations } from './components/FileOperations';
// TODO: XTREE like keyword.
export default function DriveScreen() {
const [currentPath, setCurrentPath] = useState('');
const [refreshKey, setRefreshKey] = useState(0);
const handleRefresh = () => {
setRefreshKey(prev => prev + 1);
};
return (
<div className="flex h-screen bg-white">
<FileTree onSelect={setCurrentPath} />
<div className="flex-1 flex flex-col overflow-hidden">
<FileBrowser key={`${currentPath}-${refreshKey}`} path={currentPath} />
<FileOperations currentPath={currentPath} onRefresh={handleRefresh} />
</div>
</div>
);
}