diff --git a/src/components/BucketSelect.tsx b/src/components/BucketSelect.tsx index 7854471..bd077a2 100644 --- a/src/components/BucketSelect.tsx +++ b/src/components/BucketSelect.tsx @@ -1,13 +1,18 @@ import React from "react" -import { Link } from "react-router-dom" +import { useHistory } from "react-router-dom" import { useListBucktesQuery } from "../generated/graphql" import Breadcrum from "./Breadcrum" import MoreMenu from "./MoreMenu" import { ReactComponent as Spinner } from "./../assets/spinner.svg" +import Table, { Data } from "./Table" const BucketSelect: React.FC = () => { - + const history = useHistory() const {data: buckets, loading} = useListBucktesQuery() + const tableData: Data = { + headers:[{name:"Bucket"}], + body:(!buckets?[]:buckets.buckets.map(e=>{return {cells:[{name:e||""}],onClick:()=>{history.push(`/f/${e}`)}}})) + } return (
@@ -17,13 +22,7 @@ const BucketSelect: React.FC = () => {
- + {loading &&