Sharaxaad
Ku xir React/Next.js clients APIs-kaaga fetch helpers typed, auth headers, iyo UI states adag.
Tusaale code
typescriptexport async function getSkills(token?: string) {
const res = await fetch("/api/skills", {
headers: token ? { Authorization: `Bearer ${token}` } : undefined,
cache: "no-store",
});
if (!res.ok) throw new Error("Failed to load skills");
return res.json();
}Agab waxtar leh
Layli
Ku xir Next.js UI Express/Next API oo leh loading, empty, iyo error states.
