swiftui button state change with urlsession

Hi,
I have a scenario where the button has multiple states such as
Available, Pressed, Accepted and Cancelled with corresponding textual appearances. When the button is clicked in the Available state, I make a web api call and change the button state to Pressed. Depending on the api request the state changes to accepted and cancelled.
I can accomplish the task using uikit and completion handlers, but can you suggest a way to handle the scenario using swiftui and combine (or similar)?
Thanks
My current solution is to define the state variable as @Published my model and in my swiftui view's onReceive method I apply the textual appearances through variables such as text, color etc. defined with @State property wrappers in the View. Still not sure if it is a "preferred" way.
swiftui button state change with urlsession
 
 
Q