"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const styles_1 = require("./styles");
const warnBoolean = () => 
// eslint-disable-next-line no-console
console.warn("@platformbuilders/fluid-react-native: received a truthy boolean error instead of string, which won't be rendered.");
const FormError = ({ id = 'form_error', accessibility, error = '', centered = false, large = false, children, ...rest }) => {
    if (error && typeof error === 'boolean')
        warnBoolean();
    return (<>
      {children}
      {error && typeof error === 'string' ? (<styles_1.ErrorText centered={centered} large={large} testID={`error_${id}`} accessibility={`Erro ${accessibility || error}`} accessibilityLabel={`Erro ${accessibility || error}`} {...rest}>
          {error}
        </styles_1.ErrorText>) : null}
    </>);
};
exports.default = FormError;
//# sourceMappingURL=index.js.map