Download frontend/src/hooks/useUser.js from leowuming/rag: direct link, hf CLI and curl.
- Browser
- Download file 348 Bytes
-
https://huggingface.co/spaces/leowuming/rag/resolve/main/frontend/src/hooks/useUser.js
- Command line
-
hf download hf://spaces/leowuming/rag/frontend/src/hooks/useUser.js
-
curl -L -o useUser.js https://huggingface.co/spaces/leowuming/rag/resolve/main/frontend/src/hooks/useUser.js
348 Bytes
| import { useContext } from "react"; | |
| import { AuthContext } from "@/AuthContext"; | |
| // interface IStore { | |
| // store: { | |
| // user: { | |
| // id: string; | |
| // username: string | null; | |
| // role: string; | |
| // }; | |
| // }; | |
| // } | |
| export default function useUser() { | |
| const context = useContext(AuthContext); | |
| return { ...context.store }; | |
| } | |