Skip to content

Commit

Permalink
feat: Updated frontend/src/components/HierarchySwi
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] authored Dec 14, 2023
1 parent deebe49 commit b65f1c5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions frontend/src/components/HierarchySwitcher.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@ import { Button, Menu, MenuItem } from '@mui/material';
import { useNavigation } from './NavigationContext';
import { fetchHierarchies } from '../api'; // Make sure this import points to your API fetching logic

/**
* HierarchySwitcher is a component that provides a button and menu to switch between different
* hierarchy views. It utilizes the NavigationContext to manage state, fetching hierarchies,
* and handling user interactions.
*
* There are no parameters for this function. It creates its own state and context from the component.
*
* @return {JSX.Element} A button and menu for selecting hierarchies within the application.
*/
function HierarchySwitcher() {
const { selectedHierarchy, setSelectedHierarchy, setSelectedRegion } = useNavigation();
const [hierarchies, setHierarchies] = useState([]);
Expand Down

0 comments on commit b65f1c5

Please sign in to comment.