Rewrite with React after AI got stuck in some obscure state errors on SolidJS

This commit is contained in:
2026-03-02 22:04:58 +02:00
parent 81c4c70c51
commit 154b9b66ce
38 changed files with 4131 additions and 1878 deletions

35
ui/src/state/appState.ts Normal file
View File

@@ -0,0 +1,35 @@
import { atom } from "recoil";
import type { LokOpenHours } from "~/api";
export type Language = "fi" | "en";
export type Session = {
email: string;
};
export type Toast = {
id: number;
message: string;
kind: "success" | "error";
leaving: boolean;
};
export const languageAtom = atom<Language>({
key: "languageAtom",
default: "en",
});
export const sessionAtom = atom<Session | null>({
key: "sessionAtom",
default: null,
});
export const openHoursAtom = atom<LokOpenHours[]>({
key: "openHoursAtom",
default: [],
});
export const toastsAtom = atom<Toast[]>({
key: "toastsAtom",
default: [],
});