'use client';
import { jsx as _jsx } from "react/jsx-runtime";
import { useFormContext } from 'react-hook-form';
import { FormMessageList } from './message-list.js';
export const FormServerErrorMessage = () => {
    const { formState } = useFormContext();
    if (!formState.errors.root?.serverError.message) {
        return null;
    }
    return _jsx(FormMessageList, { messages: [formState.errors.root.serverError.message], type: "error" });
};
//# sourceMappingURL=form-server-error-message.js.map