import $ from 'jquery';
import {svg} from '../../svg.js';
import {htmlEscape} from 'escape-goat';
const {i18n} = window.config;
export async function confirmModal(opts = {content: '', buttonColor: 'primary'}) {
return new Promise((resolve) => {
const $modal = $(`
${htmlEscape(opts.content)}
`);
$modal.appendTo(document.body);
$modal.modal({
onApprove() {
resolve(true);
},
onHidden() {
$modal.remove();
resolve(false);
},
}).modal('show');
});
}