// src/hooks/useUserData.tsx
import { useContext } from 'react';
import { UserDataContext, UserDataContextType } from '../contexts/UserDataContext';

export const useUserData = (): UserDataContextType => {
  const context = useContext(UserDataContext);
  if (context === undefined) {
    throw new Error('useUserData must be used within a UserDataProvider');
  }
  return context;
};
