mirror of
https://iceshrimp.dev/crimekillz/trashposs
synced 2024-11-24 17:59:05 +01:00
19 lines
391 B
TypeScript
19 lines
391 B
TypeScript
import OS from '../../mios';
|
|
import Dialog from '../views/components/dialog.vue';
|
|
|
|
export default (os: OS) => opts => {
|
|
return new Promise<string>((res, rej) => {
|
|
const o = opts || {};
|
|
const d = os.new(Dialog, {
|
|
title: o.title,
|
|
text: o.text,
|
|
modal: o.modal,
|
|
buttons: o.actions
|
|
});
|
|
d.$once('clicked', id => {
|
|
res(id);
|
|
});
|
|
document.body.appendChild(d.$el);
|
|
});
|
|
};
|