import { App } from 'antd';

export const useMessage = () => {
  const { message: antMessage, modal, notification } = App.useApp();
  return {
    success: antMessage.success,
    error: antMessage.error,
    warning: antMessage.warning,
    info: antMessage.info,
    loading: antMessage.loading,
    open: antMessage.open,
    destroy: antMessage.destroy,
    modal: modal,
    notification: notification,
    message: antMessage,
    com: (
      <>
        <App />
      </>
    ),
  };
};
