import { useQuasar } from 'quasar';
import AppNotificationDialog from 'src/components/dialogs/AppNotificationDialog.vue';

export function useNotify() {
  const { dialog } = useQuasar();

  function notifySuccess(data: { title?: string; message?: string } = { title: 'Solicitud procesada', message: '' }) {
    const { title, message } = data;
    dialog({
      component: AppNotificationDialog,
      componentProps: {
        data: {
          title,
          message,
          timer: 2000,
        },
      },
    });
  }

  return { notifySuccess };
}
