import { useEffect } from 'react';
import useMessage from 'antd/es/message/useMessage';
import { bindMessageApi } from './app-message';

const AppMessageBridge: React.FC = () => {
  const [messageApi, contextHolder] = useMessage();

  useEffect(() => {
    bindMessageApi(messageApi);
  }, [messageApi]);

  return contextHolder;
};

export default AppMessageBridge;
