feat: add bucket browser

This commit is contained in:
2024-08-19 02:28:25 +07:00
parent 934e0c409c
commit 93a1dce5f7
35 changed files with 770 additions and 137 deletions
+19
View File
@@ -0,0 +1,19 @@
import { createContext, useContext } from "react";
import { Bucket } from "../types";
export const BucketContext = createContext<{
bucket: Bucket;
refetch: () => void;
bucketName: string;
} | null>(null);
export const useBucketContext = () => {
const bucket = useContext(BucketContext);
if (!bucket) {
throw new Error(
"BucketContext must be used within a BucketContextProvider"
);
}
return bucket;
};