// CHANGE TO YOUR API DESTINATION
export const API_BASE_URL = "http://localhost:8321/admin_api.php";
// TYPE: url/dx4/
export const CLIENT_FRONTEND_URL = "http://localhost:5173/";
import { atom, useAtom } from "jotai";
import { atomWithStorage } from "jotai/utils";
import { useEffect } from "react";
import LoginPage from "./pages/LoginPage";
import DashPage from "./pages/DashPage";
import ClassProfilePage from "./pages/ClassProfile";
const passAtom = atomWithStorage("DX4DASH_pass", "");
// KATAMAZ DENGI ROUTER 4 PRO MAX ULTIMATE (from dx4, yeah, oh now in typescript)
// 💀💀
// PROS - vrode raboatat,
// too simple, lightweight, stupidly fast
// (beacause you basicly download entire site, lol)
// CONS - shit
function firstPathSegment(path: string) {
const m = path.match(/^\/?([^/]+)/);
return m ? m[1] : "";
}
const secondPathSegment = (p: string) =>
p.replace(/^\/?[^/]+/, "").replace(/^\/+/, "");
const routeAtom = atom("/");
const basePageProps = {
// atoms
passAtom,
routeAtom,
// fucntions
setsetRoute,
secondPathSegment,
// constants
API_BASE_URL,
};
const pages = {
"/":