Hi,
You can abstract that button and logic in a block.
You can use inputs the send the needed data and use it in the button logic.
Then, you can use events to notify the parent of any given changes.
After that defined you can use that block wherever you need and define the input values and the event handlers.
But, for this solution, you need to see if make sense the effort of implementing something like this (see the possible future cases of reusability and code maintainability).
Hope this can help.
Best regards,
Ricardo Pereira