maputnik/src/components/MessagePanel.jsx

27 lines
527 B
React
Raw Normal View History

2016-12-31 14:32:04 +01:00
import React from 'react'
class MessagePanel extends React.Component {
static propTypes = {
errors: React.PropTypes.array,
infos: React.PropTypes.array,
}
render() {
const errors = this.props.errors.map((m, i) => {
2017-01-11 14:11:45 +01:00
return <p className="maputnik-message-panel-error">{m}</p>
2016-12-31 14:32:04 +01:00
})
const infos = this.props.infos.map((m, i) => {
2017-01-11 14:11:45 +01:00
return <p key={i}>{m}</p>
2016-12-31 14:32:04 +01:00
})
2017-01-11 14:11:45 +01:00
return <div className="maputnik-message-panel">
2016-12-31 14:32:04 +01:00
{errors}
{infos}
</div>
}
}
export default MessagePanel