Almost done

This commit is contained in:
2026-03-05 17:35:27 +01:00 Unverified
parent 278471e53b
commit e44fceaf32
30 changed files with 1077 additions and 572 deletions
+30
View File
@@ -0,0 +1,30 @@
// app/lib/config.ts
import fs from 'node:fs/promises';
import path from 'node:path';
const configPath = path.join(process.cwd(), 'data', 'site-config.json');
export async function getConfig() {
try {
const data = await fs.readFile(configPath, 'utf-8');
return JSON.parse(data);
} catch (error) {
return {
showBeachPromo: true,
beachPage: {
matchStart: "2026-06-13T10:00",
isClosedOverride: false,
closeReason: "Det är hela 26 lag anmälda och vi kan tyvärr inte ta emot fler anmälningar.\r\n\r\nVi är glada över förväntan och bjuder in alla andra till att komma och kolla men vi har tyvärr inte kapaciteten till att ha med fler lag.",
festivalLink: "https://www.kullahalvon.com/upptacka--uppleva/kultur--noje/evenemang-pa-kullahalvon/mat---sommarfesten.html",
otherInfo: "Turneringen upskattas hålla på till ca 17-18 tiden\r\nDet kommer finnas duschmöjligheter i anslutning till stranden.",
prizesText: "Det kommer att finnas fina priser till alla pallplatser! 🏆"
}
};
};
}
export async function updateConfig(newConfig: any) {
await fs.writeFile(configPath, JSON.stringify(newConfig, null, 2));
}