import type { SignBaaRequest } from '../../../../services/BAAService.tsx'; // Edited means changed from what the form opened with. The practice's own name, address and phone // are prefilled, so an untouched form has nothing to discard. export const isBaaFormDirty = ( form: SignBaaRequest, initial: SignBaaRequest, acknowledged: boolean, ): boolean => acknowledged || (Object.keys(initial) as (keyof SignBaaRequest)[]).some( (field) => (form[field] ?? '') !== (initial[field] ?? ''), );