agent-0 / atk-interface /src /context /NavigationContext.jsx
Leon4gr45's picture
Upload folder using huggingface_hub
42da440 verified
Raw History Blame Contribute Delete
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);