18 lines
745 B
TypeScript
18 lines
745 B
TypeScript
import { atom } from "jotai";
|
|
|
|
// store which page the user is currently on
|
|
// no actual routing is done here,
|
|
// full page components are used render the different pages
|
|
// TODO: incomplete, to be updated as more pages are added
|
|
// TODO: also remove testing when done
|
|
export type Routes = "home" | "sql_injection" | "xss" | "cmd_injection" | "testing";
|
|
export const routeAtom = atom<Routes>("home");
|
|
|
|
// store the status of connection to backend
|
|
type ServerConnection = "connected" | "connecting" | "disconnected";
|
|
export const serverConnectionAtom = atom<ServerConnection>("disconnected");
|
|
|
|
// store the url of the backend server
|
|
// TODO: let user enter their own backend server url
|
|
export const serverUrlAtom = atom("http://localhost:5000");
|