import { openDialog } from 'vue3-promise-dialog';
import ConfirmDialog from '../components/ConfirmDialog.vue';
import AlertDialog from '../components/AlertDialog.vue';
import PromptDialog from '../components/PromptDialog.vue';

export async function confirm(text, title='') {
  return await openDialog(ConfirmDialog, {text, title});
}

export async function alert(text, title='', type='') {
  return await openDialog(AlertDialog, {text, title, type});
}

export async function prompt(text, title='', value='') {
  return await openDialog(PromptDialog, {text, title, value});
}