maputnik/src/components/MessagePanel.jsx

28 lines
575 B
React
Raw Normal View History

2016-12-31 14:32:04 +01:00
import React from 'react'
import PropTypes from 'prop-types'
2016-12-31 14:32:04 +01:00
class MessagePanel extends React.Component {
static propTypes = {
errors: PropTypes.array,
infos: PropTypes.array,
2016-12-31 14:32:04 +01:00
}
render() {
const errors = this.props.errors.map((m, i) => {
2017-11-08 09:47:36 +01:00
return <p key={"error-"+i} className="maputnik-message-panel-error">{m}</p>
2016-12-31 14:32:04 +01:00
})
const infos = this.props.infos.map((m, i) => {
2017-11-08 09:47:36 +01:00
return <p key={"info-"+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