2016-02-13 20:58:47 +05:30
|
|
|
import React, { Component, PropTypes } from 'react';
|
|
|
|
|
2016-05-02 13:34:23 +05:30
|
|
|
import errorsDict from 'services/errorsDict';
|
2016-02-13 20:58:47 +05:30
|
|
|
import { PanelBodyHeader } from 'components/ui/Panel';
|
|
|
|
|
|
|
|
export default class AuthError extends Component {
|
|
|
|
static displayName = 'AuthError';
|
|
|
|
|
|
|
|
static propTypes = {
|
|
|
|
error: PropTypes.string.isRequired,
|
|
|
|
onClose: PropTypes.func
|
|
|
|
};
|
|
|
|
|
|
|
|
render() {
|
|
|
|
let { error } = this.props;
|
|
|
|
|
2016-05-02 13:34:23 +05:30
|
|
|
error = errorsDict.resolve(error);
|
2016-02-13 20:58:47 +05:30
|
|
|
|
|
|
|
return (
|
|
|
|
<PanelBodyHeader type="error" onClose={this.props.onClose}>
|
|
|
|
{error}
|
|
|
|
</PanelBodyHeader>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|