Looking to streamline this function with binary inputs:
export const handleStepCompletion = (userSave: number, concur: number, signature: number) => {
if (userSave === 0 && concur === 0 && signature === 0) {
return {completed: false, active: true, error: false};
}
if ((userSave === 1 && concur === 0 && signature === 0) ||
(userSave === 1 && concur === 1 && signature === 0)) {
return {completed: true, active: true, error: false};
}
if (userSave === 1 && concur === 0 && signature === 1) {
return {completed: false, active: false, error: true};
}
};