import './style.scss';

export default new Class({
	Extends: Hedera.Form,
	Template: require('./ui.xml'),

	activate() {
		this.basket = new Hedera.Basket(this.app);
		this.$.orders.setInfo('o', 'myOrder', 'hedera', ['id'], 'id');
	},

	async onRemoveOrderClick(form) {
		if (confirm(_('AreYouSureDeleteOrder')))
			await form.deleteRow();
	},

	async loadOrder(id) {
		const basket = new Hedera.Basket(this.app);
		await basket.load(id);
	}
});
