2018-03-25 10:54:45 +09:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { registerComponent } from 'meteor/vulcan:core';
|
|
|
|
import { FormattedMessage } from 'meteor/vulcan:i18n';
|
|
|
|
|
|
|
|
const FieldErrors = ({ errors }) => (
|
|
|
|
<ul className="form-input-errors">
|
|
|
|
{errors.map((error, index) => (
|
|
|
|
<li key={index}>
|
|
|
|
{error.message || (
|
|
|
|
<FormattedMessage
|
2018-03-29 11:58:24 +09:00
|
|
|
id={error.id}
|
2018-03-25 10:54:45 +09:00
|
|
|
values={{ ...error.data }}
|
|
|
|
defaultMessage={JSON.stringify(error)}
|
|
|
|
/>
|
|
|
|
)}
|
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
);
|
|
|
|
registerComponent('FieldErrors', FieldErrors);
|