import { useContext } from 'react';
import { ChatContext } from '@/context/chat/ChatContext.tsx';
import { ChatContextType } from '@/types/types.ts';

export const useChat = (): ChatContextType => {
  const context = useContext(ChatContext);
  if (!context) {
    throw new Error('useChat must be used within ChatProvider');
  }
  return context;
};
