import { useParams } from "react-router-dom"; import { Card } from "react-daisyui"; import ObjectList from "./object-list"; import { useBucket } from "../hooks"; import { useState } from "react"; import ObjectListNavigator from "./object-list-navigator"; import { EllipsisVertical, FilePlus, FolderPlus, UploadIcon, } from "lucide-react"; import Button from "@/components/ui/button"; const BrowseTab = () => { const { id } = useParams(); const { data: bucket } = useBucket(id); const [curPrefix, setCurPrefix] = useState(-1); const [prefixHistory, setPrefixHistory] = useState([]); const bucketName = bucket?.globalAliases[0]; const gotoPrefix = (prefix: string) => { const history = prefixHistory.slice(0, curPrefix + 1); setPrefixHistory([...history, prefix]); setCurPrefix(history.length); }; if (!bucket) { return null; } if (!bucket.keys.find((k) => k.permissions.read && k.permissions.write)) { return (

You need to add a key to your bucket to be able to browse it.

); } return (
); }; export default BrowseTab;