@atlaskit/form
Version:
A form allows people to input information.
21 lines (20 loc) • 673 B
JavaScript
import React from 'react';
import { FieldId } from './field-id-context';
import Message from './message';
/**
* __Helper message__
*
* A helper message tells the user what kind of input the field takes. For example, a helper message could be
* 'Password should be more than 4 characters'
*
*/
export var HelperMessage = function HelperMessage(_ref) {
var children = _ref.children,
testId = _ref.testId;
return /*#__PURE__*/React.createElement(FieldId.Consumer, null, function (fieldId) {
return /*#__PURE__*/React.createElement(Message, {
fieldId: fieldId ? "".concat(fieldId, "-helper") : undefined,
testId: testId
}, children);
});
};