import i18n from "@/lib/i18n/config";
import * as Yup from "yup";
import { YupEmail, YupRequiredString } from "@/features/shared/schemas";

export const buildContactFormSchema = () => Yup.object({
  // The API's limits (`ContactController::store`): name 100, message 5000.
  name: Yup.string().trim().max(100, () => `${i18n.t("COMMON.MUST.BE.ATMOST")}100${i18n.t("COMMON.CHARACTERS")}`),
  email: YupEmail,
  message: Yup.string().concat(YupRequiredString).max(5000, () => `${i18n.t("COMMON.MUST.BE.ATMOST")}5000${i18n.t("COMMON.CHARACTERS")}`),
});
