@@ -8,7 +8,7 @@ import TextInput from '@components/TextInput';
88import useLocalize from '@hooks/useLocalize' ;
99import type { SubStepProps } from '@hooks/useSubStep/types' ;
1010import useThemeStyles from '@hooks/useThemeStyles' ;
11- import { getFieldRequiredErrors , isRequiredFulfilled , isValidLegalName } from '@libs/ValidationUtils' ;
11+ import { doesContainReservedWord , getFieldRequiredErrors , isRequiredFulfilled , isValidLegalName } from '@libs/ValidationUtils' ;
1212import HelpLinks from '@pages/ReimbursementAccount/USD/Requestor/PersonalInfo/HelpLinks' ;
1313import CONST from '@src/CONST' ;
1414import type { OnyxFormValuesMapping } from '@src/ONYXKEYS' ;
@@ -87,6 +87,11 @@ function FullNameStep<TFormID extends keyof OnyxFormValuesMapping>({
8787 } ) ;
8888 }
8989
90+ if ( doesContainReservedWord ( firstName , CONST . DISPLAY_NAME . RESERVED_NAMES ) ) {
91+ // @ts -expect-error type mismatch to be fixed
92+ errors [ firstNameInputID ] = translate ( 'personalDetails.error.containsReservedWord' ) ;
93+ }
94+
9095 const lastName = values [ lastNameInputID as keyof FormOnyxValues < TFormID > ] as string ;
9196 if ( ! isRequiredFulfilled ( lastName ) ) {
9297 // @ts -expect-error type mismatch to be fixed
@@ -101,6 +106,11 @@ function FullNameStep<TFormID extends keyof OnyxFormValuesMapping>({
101106 limit : CONST . LEGAL_NAME . MAX_LENGTH ,
102107 } ) ;
103108 }
109+
110+ if ( doesContainReservedWord ( lastName , CONST . DISPLAY_NAME . RESERVED_NAMES ) ) {
111+ // @ts -expect-error type mismatch to be fixed
112+ errors [ lastNameInputID ] = translate ( 'personalDetails.error.containsReservedWord' ) ;
113+ }
104114 return errors ;
105115 } ,
106116 [ firstNameInputID , lastNameInputID , stepFields , translate ] ,
0 commit comments