'use client';

import { useFormField } from "./FormField.mjs";
import { jsx } from "react/jsx-runtime";

//#region src/components/Form/FormMessage.tsx
const FormMessage = ({ children, ...props }) => {
	const { error, formMessageId } = useFormField();
	const body = error ? String(error?.message ?? "") : children;
	if (!body) return null;
	return /* @__PURE__ */ jsx("p", {
		className: "font-medium text-error text-xs",
		role: "alert",
		id: formMessageId,
		...props,
		children: body
	});
};

//#endregion
export { FormMessage };
//# sourceMappingURL=FormMessage.mjs.map