mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 09:25:43 +01:00
35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import React from "react";
|
|
import { WithTranslation, withTranslation } from "react-i18next";
|
|
import { Notification } from "@scm-manager/ui-components";
|
|
import { PluginAction } from "./PluginEntry";
|
|
|
|
type Props = WithTranslation & {
|
|
pluginAction?: string;
|
|
};
|
|
|
|
class InstallSuccessNotification extends React.Component<Props> {
|
|
createMessageForPluginAction = () => {
|
|
const { pluginAction, t } = this.props;
|
|
if (pluginAction === PluginAction.INSTALL) {
|
|
return t("plugins.modal.installedNotification");
|
|
} else if (pluginAction === PluginAction.UPDATE) {
|
|
return t("plugins.modal.updatedNotification");
|
|
} else if (pluginAction === PluginAction.UNINSTALL) {
|
|
return t("plugins.modal.uninstalledNotification");
|
|
}
|
|
return t("plugins.modal.executedChangesNotification");
|
|
};
|
|
|
|
render() {
|
|
const { t } = this.props;
|
|
return (
|
|
<Notification type="success">
|
|
{this.createMessageForPluginAction()}{" "}
|
|
<a onClick={e => window.location.reload(true)}>{t("plugins.modal.reload")}</a>
|
|
</Notification>
|
|
);
|
|
}
|
|
}
|
|
|
|
export default withTranslation("admin")(InstallSuccessNotification);
|