feat: add bucket object browser

This commit is contained in:
2024-08-18 22:57:08 +07:00
parent 3a147f4133
commit 934e0c409c
29 changed files with 656 additions and 18 deletions
+3 -1
View File
@@ -4,10 +4,12 @@ type FetchOptions = Omit<RequestInit, "headers" | "body"> & {
body?: any;
};
export const API_URL = "/api";
const api = {
async fetch<T = any>(url: string, options?: Partial<FetchOptions>) {
const headers: Record<string, string> = {};
const _url = new URL("/api" + url, window.location.origin);
const _url = new URL(API_URL + url, window.location.origin);
if (options?.params) {
Object.entries(options.params).forEach(([key, value]) => {
+5
View File
@@ -1,6 +1,11 @@
import clsx from "clsx";
import { toast } from "sonner";
import { twMerge } from "tailwind-merge";
import dayjsRelativeTime from "dayjs/plugin/relativeTime";
import dayjs from "dayjs";
dayjs.extend(dayjsRelativeTime);
export { dayjs };
export const cn = (...args: any[]) => {
return twMerge(clsx(...args));