Download atk-interface/src/context/NavigationContext.jsx from Leon4gr45/agent-0: direct link, hf CLI and curl.
- Browser
- Download file 617 Bytes
-
https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/atk-interface/src/context/NavigationContext.jsx
- Command line
-
hf download hf://spaces/Leon4gr45/agent-0/atk-interface/src/context/NavigationContext.jsx
-
curl -L -o NavigationContext.jsx https://huggingface.co/spaces/Leon4gr45/agent-0/resolve/main/atk-interface/src/context/NavigationContext.jsx
617 Bytes
| import React, { createContext, useContext, useState } from 'react'; | |
| // Context to store which nav link should be highlighted (in addition to the active one) | |
| const NavigationContext = createContext({ | |
| highlightedNavLink: null, | |
| setHighlightedNavLink: () => {}, | |
| }); | |
| export const NavigationProvider = ({ children }) => { | |
| const [highlightedNavLink, setHighlightedNavLink] = useState(null); | |
| return ( | |
| <NavigationContext.Provider value={{ highlightedNavLink, setHighlightedNavLink }}> | |
| {children} | |
| </NavigationContext.Provider> | |
| ); | |
| }; | |
| export const useNavigation = () => useContext(NavigationContext); |