"use client"; import { useT } from "@/app/lib/i18n/MessagesProvider"; /** One field's validation message (client check or the backend's field-path reason). A message code is * translated; backend text is not a code, so t returns it unchanged. `error` is the raw error-map entry this shows * (defaults to `message`), carried in data-error so a page can tell which errors are shown however they are worded. */ export function FieldError({ message, error = message }: { message?: string; error?: string }) { const t = useT(); if (!message) return null; return (
{t(message)}
); }