import React from 'react'
import type { GridLiveRegionContextType } from './types'

const error = 'Cannot use GridLiveRegionContext without a provider'

const errorHandler = () => {
    throw new Error(error)
}

export const GridLiveRegionContext =
    React.createContext<GridLiveRegionContextType>({
        announcement: '',
        setAnnouncement: errorHandler,
    })
