import Component from '@glimmer/component';
import { action } from '@ember/object';
import { on } from '@ember/modifier';
import config from 'marco/config/environment';
import Icon from './icon';
const ModalContent =
;
export default class Modal extends Component {
get isTesting() {
return config.environment === 'test';
}
get destinationElement() {
return document.getElementById('modal-portal') || document.body;
}
@action
stopProp(e) {
e.stopPropagation();
}
@action
close() {
if (this.args.disableClose) return;
if (this.args.onClose) {
this.args.onClose();
}
}
{{#if this.isTesting}}
{{yield}}
{{else}}
{{#in-element this.destinationElement}}
{{yield}}
{{/in-element}}
{{/if}}
}