Add Tailwind + shadcn UI primitives; add React Query + Orval client

This commit is contained in:
Abhimanyu Saharan
2026-02-01 23:26:21 +05:30
parent aa6b0c807b
commit 87d454852c
47 changed files with 4262 additions and 164 deletions

View File

@@ -0,0 +1,22 @@
export async function customFetch<T>(
url: string,
options: RequestInit,
): Promise<T> {
const base = process.env.NEXT_PUBLIC_API_URL;
if (!base) throw new Error("NEXT_PUBLIC_API_URL is not set");
const res = await fetch(`${base}${url}`, {
...options,
headers: {
"Content-Type": "application/json",
...(options.headers ?? {}),
},
});
if (!res.ok) {
const text = await res.text().catch(() => "");
throw new Error(`${res.status} ${res.statusText}${text ? `: ${text}` : ""}`);
}
return (await res.json()) as T;
}