Files
autocraft/web/src/shell/UserContext.ts
T
aiongg cef94422c0 Dashboard frontend design: ui-design doc and web/ mockup
Design language from ArtCraft's brutalist system, a module/panel registry
shell with per-user resizable layouts, a typed API with a fixture-backed
mock, and the Decisions inbox (operator, maintainer and viewer states),
Item and Progress screens.
2026-11-02 15:34:02 +00:00

10 lines
290 B
TypeScript

import { createContext, useContext } from "react";
import type { User } from "../api/types";
export const UserContext = createContext<User | null>(null);
export function useUser(): User {
const u = useContext(UserContext);
if (!u) throw new Error("UserContext missing");
return u;
}