import {
    getValidateVFromString,
    handleValidateCheck,
  } from "../PublicSector/InvalidMessage/utils"
  
  export const getValidateMessageFunc = (
    value: string | undefined,
    options: {
      hideValidationMessage?: any
      pattern?:any
      regex?: any
      minLength?: any
      maxLength?: any
      required?: any
      customRule?: any
    } = {},
  ) => {
    const {
      hideValidationMessage,
      pattern,
      regex,
      maxLength,
      minLength,
      required,
      customRule,
    } = options
    if (!hideValidationMessage) {
      const message = handleValidateCheck({
        value: getValidateVFromString(value),
        pattern,
        regex,
        minLength,
        maxLength,
        required,
        customRule,
      })
      const showMessage = message && message.length > 0
      return showMessage ? message : ""
    }
    return ""
  }
  