mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-03 06:34:27 +01:00
31 lines
635 B
JavaScript
31 lines
635 B
JavaScript
import React from 'react'
|
|
import PropTypes from 'prop-types'
|
|
|
|
const ErrorMessage = (props, context) => {
|
|
const { errorMessage, errorKey } = props
|
|
const error = errorKey ? context.t(errorKey) : errorMessage
|
|
|
|
return (
|
|
<div className="error-message">
|
|
<img
|
|
src="/images/alert-red.svg"
|
|
className="error-message__icon"
|
|
/>
|
|
<div className="error-message__text">
|
|
{ `ALERT: ${error}` }
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
ErrorMessage.propTypes = {
|
|
errorMessage: PropTypes.string,
|
|
errorKey: PropTypes.string,
|
|
}
|
|
|
|
ErrorMessage.contextTypes = {
|
|
t: PropTypes.func,
|
|
}
|
|
|
|
export default ErrorMessage
|