mirror of
https://github.com/storytold/autocraft.git
synced 2026-11-29 09:33:55 +01:00
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.
10 lines
290 B
TypeScript
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;
|
|
}
|