import { useContext } from 'react' ; import { AnnotationsContext } from './annotations_context' ; export function useAnnotationsContext ( ) { const context = useContext ( AnnotationsContext ) ; if ( ! context ) { throw new Error ( 'Missing Annotations context provider' ) ; } return context ; }