{"mappings":"6ZAAA,IAAAA,EAAAC,EAAA,S,aAgBO,SAASC,EAAQC,GACvB,OAAQA,EAAMC,OAAOD,EAAME,YAAeF,EAAMG,MAAQH,EAAMC,OAAOD,EAAME,WAAWC,OAASH,EAAMG,I,CAG/F,SAASC,EAAuBJ,GACtC,MAAMK,gBAAEA,IAAoBC,mBAC5B,GAAIP,EAAQC,GACX,OAAO,KAGR,MAAMO,EACLP,EAAMG,MAAuB,aAAfH,EAAMG,KACjBE,EAAgB,4BAChBA,EAAgB,4BAEpB,OACC,EAAAR,EAAAW,KAAC,MAAG,CAACC,UAAU,qBAAqBC,GAAIV,EAAMU,G,SAC5CV,EAAMW,SAAWJ,G","sources":["src/Components/ValidationErrorDisplay.tsx"],"sourcesContent":["import { useResource } from './ResourceText';\nimport React, { ReactNode } from 'react';\n\nexport interface IValidationErrorProps {\n\terrors: any;\n\tfieldName: string;\n\ttype?: ValidationType;\n}\n\ninterface IValidationErrorDisplayProps extends IValidationErrorProps {\n\tmessage?: ReactNode;\n\tid?: string;\n}\n\nexport type ValidationType = 'required' | 'validate';\n\nexport function isValid(props: IValidationErrorProps) {\n\treturn !props.errors[props.fieldName] || (props.type && props.errors[props.fieldName].type !== props.type);\n}\n\nexport function ValidationErrorDisplay(props: IValidationErrorDisplayProps) {\n\tconst { getResourceText } = useResource();\n\tif (isValid(props)) {\n\t\treturn null;\n\t}\n\n\tconst defaultMessage =\n\t\tprops.type && props.type === 'validate'\n\t\t\t? getResourceText('Validation_InvalidFormat')\n\t\t\t: getResourceText('Validation_RequiredField');\n\n\treturn (\n\t\t<div className=\"input-basic__error\" id={props.id}>\n\t\t\t{props.message || defaultMessage}\n\t\t</div>\n\t);\n}\n"],"names":["$ed3kz","parcelRequire","isValid","props","errors","fieldName","type","ValidationErrorDisplay","getResourceText","useResource","defaultMessage","jsx","className","id","message"],"version":3,"file":"Contact.2f4cab22.js.map"}