import { useTranslation } from "react-i18next";
import FormToggleButton from "../FormToggleButton";
import React from "react";
import getIsEMEA from "./getIsEMEA";

const IsPoBox = ({currentCountry, register, errors: { isPoBox } }) => {
  const { t } = useTranslation('components-form');
  return !getIsEMEA(currentCountry) && <FormToggleButton
    name="1"
    {...register("isPoBox")}
    error={isPoBox}
  >{t("This address is a PO Box")}
  </FormToggleButton>;
};

export default IsPoBox;