import { Typography } from '@material-ui/core';
import React from 'react';
import { FormSpy } from 'react-final-form';
/**
 * Displays form-wide validation and submit errors in a MUI Typography error element
 */
export const FormError = props => {
    return (React.createElement(FormSpy, { subscription: { error: true, submitError: true } }, ({ error, submitError }) => {
        if (error || submitError) {
            return (React.createElement(Typography, Object.assign({ component: "p", paragraph: true }, props, { color: "error" }), error || submitError));
        }
        return null;
    }));
};
//# sourceMappingURL=FormError.js.map