import { useContext } from 'react'
import { LocalDataContext } from './LocalDataContext'

export const useLocalData = () => {
  const context = useContext(LocalDataContext)
  if (!context) {
    throw new Error('useLocalData must be used within LocalDataProvider')
  }
  return context
}
