Files
address-verification-app/src/components/form/utils.ts
2025-04-01 19:58:49 +05:30

15 lines
422 B
TypeScript

import { formatAmount } from '@rn-ui-lib/utils/amount';
export const validateInputValue = (
data: { answer: any; type: string },
foreclosureAmount: number
) => {
if (!foreclosureAmount) {
return { showValidationError: false, errMessage: '' };
}
return {
showValidationError: data?.answer > foreclosureAmount,
errMessage: `PTP cannot exceed foreclosure (${formatAmount(foreclosureAmount)})`,
};
};