Why not just using a confirm modal since we're using Mantine?
If not (because that could be too limited), why even not using a confirmDeleteModal using the context Modals which helps (a lot, actually) simplifying the callbacks.
You don't need to add a state variable to save which item you clicked and then if you have one selected you open a modal, then you have to remember about removing the saved item locally after deleting it... you just need to add a dynamic callback to the button
Why not just using a confirm modal since we're using Mantine?
If not (because that could be too limited), why even not using a
confirmDeleteModal
using the context Modals which helps (a lot, actually) simplifying the callbacks.You don't need to add a state variable to save which item you clicked and then if you have one selected you open a modal, then you have to remember about removing the saved item locally after deleting it... you just need to add a dynamic callback to the button
PseudoCode: