Three actions: draft, publish, or cancel
Review a release, save a private draft, or publish it. Simulate an error and retry inside the dialog.
Release review
Save privately, publish now, or cancel. Try a publish failure to see the dialog stay open with both actions available for a new attempt.
The release is still a draft.
const flow = useSubmitFlow({
save: {
run: saveDraft,
pendingLabel: 'Saving draft…',
feedback: 'inline',
onSuccess: closeDialog,
},
publish: {
run: publishRelease,
pendingLabel: 'Publishing…',
feedback: 'inline',
error: 'Publishing failed. Try again or save a draft.',
onSuccess: closeDialog,
},
})
// Dialog footer: CancelButton + save ActionButton + publish ActionButton.This demo uses a local, temporary action. It does not send data or write to a service.