How can I give a confirmation dialog box when I change the workflow state?

you can follow below

let promise = new Promise((resolve, reject) =>{
     frappe.dom.unfreeze()