This commit is contained in:
Julien Froidefond
2025-08-20 15:43:24 +02:00
commit 09d2c5cbe1
100 changed files with 12494 additions and 0 deletions

33
lib/data-loader.ts Normal file
View File

@@ -0,0 +1,33 @@
import { SkillCategory, Team } from "./types";
export async function loadSkillCategories(): Promise<SkillCategory[]> {
const categories = ["frontend", "backend", "devops", "mobile"];
const skillCategories: SkillCategory[] = [];
for (const category of categories) {
try {
const response = await fetch(`/data/skills/${category}.json`);
if (response.ok) {
const data = await response.json();
skillCategories.push(data);
}
} catch (error) {
console.error(`Failed to load ${category} skills:`, error);
}
}
return skillCategories;
}
export async function loadTeams(): Promise<Team[]> {
try {
const response = await fetch("/data/teams.json");
if (response.ok) {
const data = await response.json();
return data.teams;
}
} catch (error) {
console.error("Failed to load teams:", error);
}
return [];
}