import { useContext } from 'react';
import { MessageDialogContext } from '../context/message-dialog-context';

export function useMessageDialog() {
  const context = useContext(MessageDialogContext);

  if (!context) {
    throw new Error('useMessageDialog must be used within a MessageDialogProvider');
  }

  return context;
}