// Copyright (c) 2025, JINGROW
// For license information, please see license.txt

jingrow.ui.form.on('Incident Investigator', {
	refresh(frm) {
		if (frm.pg.status == 'Pending') {
			frm.add_custom_button(
				'Start Investigation',
				() => {
					frm.call('start_investigation').then(() => {
						jingrow.msgprint({
							title: __('Start investigation'),
							indicator: 'green',
							message: __('Investigation started'),
						});
						frm.refresh();
					});
				},
				__('Actions'),
			);
		}
	},
});
