import { useTranslation } from "react-i18next";
import { z } from "zod";

export function useEmailValidator() {
	const { t } = useTranslation("translation");

	const emailValidator = z
		.string({
			required_error: t("Email is required"),
			invalid_type_error: t("Must be a string"),
		})
		.email(t("Invalid email format"));

	return emailValidator;
}
