2018-03-25 10:54:45 +09:00
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
2018-06-27 19:33:06 +02:00
|
|
|
import { registerComponent, Components } from 'meteor/vulcan:core';
|
2018-03-25 10:54:45 +09:00
|
|
|
|
|
|
|
const FieldErrors = ({ errors }) => (
|
|
|
|
<ul className="form-input-errors">
|
|
|
|
{errors.map((error, index) => (
|
|
|
|
<li key={index}>
|
2018-06-29 19:26:06 +02:00
|
|
|
<Components.FormError error={error} errorContext="field" />
|
2018-03-25 10:54:45 +09:00
|
|
|
</li>
|
|
|
|
))}
|
|
|
|
</ul>
|
|
|
|
);
|
2018-10-25 12:07:50 +02:00
|
|
|
FieldErrors.propTypes = {
|
|
|
|
errors: PropTypes.array.isRequired
|
|
|
|
};
|
2018-03-25 10:54:45 +09:00
|
|
|
registerComponent('FieldErrors', FieldErrors);
|