use-menu-bar.tsx 314 B

12345678910
  1. import { MenuBarContext } from '@/shared/context/menu-bar-context'
  2. import { useContext } from 'react'
  3. export const useMenuBar = () => {
  4. const context = useContext(MenuBarContext)
  5. if (context === undefined) {
  6. throw new Error('useMenuBarContext must be used within a MenuBarContext')
  7. }
  8. return context
  9. }