Livewire & Alpine - Confirmation box best practice?

Hi. Using Livewire and Alpine I want to achieve the following flow:

User pressed delete
Confirmation box appears asking user to confirm deletion
If user confirms, visit Livewire controller and process.

What’s the best practice to achieve this?

Well…

The way i did it was by creating a modal component that has the message, and the buttons to confirm and to cancel… somethin like that:

On the datatable or wherever is the delete button or something else that has to be confirmed, where the user clicks onte the delete button for example, the component that holds the datatable fire up an event for the modal component that shows the message. like this:

So, when the user clicks on delete button, the modal is shown and the user can confirm or cancel the action. If confirmed, the modal component fires up an event to datatable component that proceeds with the propper action. If canceled them model component just hide the modal.

I didi like this…

Would it be possible to share your code about how you achieved this?