mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-07 05:55:44 +01:00
26 lines
550 B
JavaScript
26 lines
550 B
JavaScript
|
|
//@flow
|
||
|
|
import React from "react";
|
||
|
|
import { translate } from "react-i18next";
|
||
|
|
import Notification from "./Notification";
|
||
|
|
|
||
|
|
type Props = {
|
||
|
|
t: string => string,
|
||
|
|
error?: Error
|
||
|
|
};
|
||
|
|
|
||
|
|
class ErrorNotification extends React.Component<Props> {
|
||
|
|
render() {
|
||
|
|
const { t, error } = this.props;
|
||
|
|
if (error) {
|
||
|
|
return (
|
||
|
|
<Notification type="danger">
|
||
|
|
<strong>{t("error-notification.prefix")}:</strong> {error.message}
|
||
|
|
</Notification>
|
||
|
|
);
|
||
|
|
}
|
||
|
|
return "";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
export default translate("commons")(ErrorNotification);
|