Building a Generic State Machine for Form Handling Using XState