import React from "react" import { useState } from "react" import { useOpenDirQuery } from "../generated/graphql" import Breadcrum from "./Breadcrum" import FileBrowserElement from "./FileBrowserElement" import FileOpen from "./FileOpen" const FileBrowser: React.FC = () => { const [path,setPath] = useState("/") const [openFileId, setOpenFileId] = useState("") const [showFile, setShowFile] = useState(false) const { data, loading } = useOpenDirQuery({ variables:{ path } }) return (
{ setPath(newPath) }}/>
{loading &&
// TODO: center } { data?.directorys.map(v => ({ setPath(dir.id) }} />))} { data?.files.map(v => ({ setOpenFileId(file.id) setShowFile(true) }} />))}
Name Size
{{ setShowFile(false) }} />}
) } export default FileBrowser