import {svg} from '../../svg.ts'; import {htmlEscape} from 'escape-goat'; import {createElementFromHTML} from '../../utils/dom.ts'; import {fomanticQuery} from '../../modules/fomantic/base.ts'; const {i18n} = window.config; export function confirmModal(content, {confirmButtonColor = 'primary'} = {}) { return new Promise((resolve) => { const modal = createElementFromHTML(` `); document.body.append(modal); const $modal = fomanticQuery(modal); $modal.modal({ onApprove() { resolve(true); }, onHidden() { $modal.remove(); resolve(false); }, }).modal('show'); }); }