How can I change modal action baased on react useForm isDirtry formState? I am a newbie in JS and React, any help would greatly be appreciated.