export const validateName = (rule, value, callback) => {
	var str = ""
	if (!value) {
		str = 'Please input the name'
	} else if (value.length < 2 || value.length > 20) {
		str = 'Name length must be between 2 and 20 characters'
	}
	callback(str ? new Error(str) : undefined)
}
export const validateEmail = (rule, value, callback) => {
	const emailRegex = /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}(\.[a-zA-Z]{2,})?$/
	var str = ''
	if (!value) {
		str = 'Please input the email'
	} else if (!emailRegex.test(value)) {
		str = 'Please input the email again'
	}
	callback(str ? new Error(str) : undefined)
}
export const validatePass = (rule, value, callback) => {
	var str = ''
	if (!value) {
		str = 'Please input the password'
	} else if (value.length < 6 || value.length > 20) {
		str = 'Password length must be between 6 and 20 characters'
	}
	callback(str ? new Error(str) : undefined)
}
export const validatePrivacy = (rule, value, callback) => {
	if (!value) {
		callback(new Error('Please agree to the Terms, Policy and Fees'))
	} else {
		callback()
	}
}