import { SkillCategory, Team } from "./types"; export async function loadSkillCategories(): Promise { try { const response = await fetch("/api/skills"); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } catch (error) { console.error("Failed to load skill categories:", error); return []; } } /** * Load skill categories from local files (fallback or development mode) * This is a client-side safe alternative that still uses the API * For server-side file loading, use loadSkillCategoriesFromFiles from skill-file-loader */ export async function loadSkillCategoriesFromAPI(): Promise { return loadSkillCategories(); } export async function loadTeams(): Promise { try { const response = await fetch("/api/teams"); if (!response.ok) { throw new Error(`HTTP error! status: ${response.status}`); } return await response.json(); } catch (error) { console.error("Failed to load teams:", error); return []; } }