@pollar/react 0.11.4-rc.1 → 0.11.4-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1036,7 +1036,7 @@ var PollarModalFooter = ({ shield = false }) => {
1036
1036
  /* @__PURE__ */ jsx("span", { className: "pollar-footer-name", children: "Pollar" }),
1037
1037
  /* @__PURE__ */ jsxs("span", { className: "pollar-footer-version", children: [
1038
1038
  "v",
1039
- "0.11.4-rc.1"
1039
+ "0.11.4-rc.2"
1040
1040
  ] })
1041
1041
  ] })
1042
1042
  ] });
@@ -3913,6 +3913,7 @@ var REGISTRY_COPY = {
3913
3913
  notApplicable: "This check is only for Bolivian ID cards (CI). Your verified document is not one, so this route is not available.",
3914
3914
  identityRequired: "Verify your identity first.",
3915
3915
  nameMismatch: "Both surnames together must read as on your document: {full}.",
3916
+ rejected: "The registry did not confirm: {fields}. Check how they are written and try again.",
3916
3917
  loadError: "Could not load your details. Please try again.",
3917
3918
  submitError: "Could not check your details. Please try again.",
3918
3919
  step: "Step {n} of {total}"
@@ -3934,6 +3935,7 @@ var REGISTRY_COPY = {
3934
3935
  notApplicable: "Esta validaci\xF3n es solo para c\xE9dulas bolivianas (CI). Tu documento verificado no lo es, as\xED que esta ruta no est\xE1 disponible.",
3935
3936
  identityRequired: "Primero verifica tu identidad.",
3936
3937
  nameMismatch: "Los dos apellidos juntos deben leerse como en tu documento: {full}.",
3938
+ rejected: "El registro no confirm\xF3: {fields}. Revisa c\xF3mo est\xE1n escritos e intenta de nuevo.",
3937
3939
  loadError: "No se pudieron cargar tus datos. Intenta de nuevo.",
3938
3940
  submitError: "No se pudieron validar tus datos. Intenta de nuevo.",
3939
3941
  step: "Paso {n} de {total}"
@@ -4027,6 +4029,7 @@ function RegistryCheckModal({ optionId, progress, onClose, onApproved }) {
4027
4029
  if (loaded.status === "approved") return onApproved();
4028
4030
  setCheck(loaded);
4029
4031
  if (loaded.status === "pending") setReview(true);
4032
+ if (loaded.status === "rejected") setError(rejectedMessage(loaded.rejectedFields));
4030
4033
  if (loaded.prefill.applies) {
4031
4034
  setSurname1(loaded.prefill.surname1);
4032
4035
  setSurname2(loaded.prefill.surname2 ?? "");
@@ -4038,6 +4041,11 @@ function RegistryCheckModal({ optionId, progress, onClose, onApproved }) {
4038
4041
  });
4039
4042
  }, [optionId]);
4040
4043
  const prefill = check?.prefill.applies ? check.prefill : null;
4044
+ function rejectedMessage(fields) {
4045
+ const labels = { surname1: copy.surname1, surname2: copy.surname2, complementNumber: copy.complement };
4046
+ const named = (fields ?? []).map((field) => labels[field] ?? field);
4047
+ return copy.rejected.replace("{fields}", named.length ? named.join(", ") : copy.surname2);
4048
+ }
4041
4049
  async function submit() {
4042
4050
  if (!prefill) return;
4043
4051
  setSubmitting(true);
@@ -4050,6 +4058,7 @@ function RegistryCheckModal({ optionId, progress, onClose, onApproved }) {
4050
4058
  });
4051
4059
  if (!mounted.current) return;
4052
4060
  if (result.status === "approved") onApproved();
4061
+ else if (result.status === "rejected") setError(rejectedMessage(result.rejectedFields));
4053
4062
  else setReview(true);
4054
4063
  } catch (e) {
4055
4064
  if (!mounted.current) return;