From 6e6f8caca807979be4889a5c1292aa15309a6a3a Mon Sep 17 00:00:00 2001
From: Marco Rodolfi <marco.rodolfi@tuta.io>
Date: Sat, 27 May 2023 13:55:26 +0200
Subject: Unified translation classes, fixed missing toaster translation and
 improved the error styling report.

---
 .../src/components/modals/TPluginInstallModal.tsx  | 95 ----------------------
 1 file changed, 95 deletions(-)
 delete mode 100644 frontend/src/components/modals/TPluginInstallModal.tsx

(limited to 'frontend/src/components/modals/TPluginInstallModal.tsx')

diff --git a/frontend/src/components/modals/TPluginInstallModal.tsx b/frontend/src/components/modals/TPluginInstallModal.tsx
deleted file mode 100644
index 3866560e..00000000
--- a/frontend/src/components/modals/TPluginInstallModal.tsx
+++ /dev/null
@@ -1,95 +0,0 @@
-import { FC } from 'react';
-import { Translation } from 'react-i18next';
-
-import { InstallType } from '../../plugin';
-
-export enum TranslatedPart {
-  TITLE,
-  DESC,
-  BUTTON_IDLE,
-  BUTTON_PROC,
-}
-interface TPluginInstallModalProps {
-  trans_part: TranslatedPart;
-  trans_type: number;
-  artifact?: string;
-  version?: string;
-}
-
-const TPluginInstallModal: FC<TPluginInstallModalProps> = ({ trans_part, trans_type, artifact, version }) => {
-  return (
-    <Translation>
-      {(t, {}) => {
-        switch (trans_part) {
-          case TranslatedPart.TITLE:
-            switch (trans_type) {
-              case InstallType.INSTALL:
-                return <div>{t('PluginInstallModal.install.title', { artifact: artifact })}</div>;
-              case InstallType.REINSTALL:
-                return <div>{t('PluginInstallModal.reinstall.title', { artifact: artifact })}</div>;
-              case InstallType.UPDATE:
-                return <div>{t('PluginInstallModal.update.title', { artifact: artifact })}</div>;
-              default:
-                return null;
-            }
-          case TranslatedPart.DESC:
-            switch (trans_type) {
-              case InstallType.INSTALL:
-                return (
-                  <div>
-                    {t('PluginInstallModal.install.desc', {
-                      artifact: artifact,
-                      version: version,
-                    })}
-                  </div>
-                );
-              case InstallType.REINSTALL:
-                return (
-                  <div>
-                    {t('PluginInstallModal.reinstall.desc', {
-                      artifact: artifact,
-                      version: version,
-                    })}
-                  </div>
-                );
-              case InstallType.UPDATE:
-                return (
-                  <div>
-                    {t('PluginInstallModal.update.desc', {
-                      artifact: artifact,
-                      version: version,
-                    })}
-                  </div>
-                );
-              default:
-                return null;
-            }
-          case TranslatedPart.BUTTON_IDLE:
-            switch (trans_type) {
-              case InstallType.INSTALL:
-                return <div>{t('PluginInstallModal.install.button_idle')}</div>;
-              case InstallType.REINSTALL:
-                return <div>{t('PluginInstallModal.reinstall.button_idle')}</div>;
-              case InstallType.UPDATE:
-                return <div>{t('PluginInstallModal.update.button_idle')}</div>;
-              default:
-                return null;
-            }
-          case TranslatedPart.BUTTON_PROC:
-            switch (trans_type) {
-              case InstallType.INSTALL:
-                return <div>{t('PluginInstallModal.install.button_processing')}</div>;
-              case InstallType.REINSTALL:
-                return <div>{t('PluginInstallModal.reinstall.button_processing')}</div>;
-              case InstallType.UPDATE:
-                return <div>{t('PluginInstallModal.update.button_processing')}</div>;
-              default:
-                return null;
-            }
-        }
-      }}
-    </Translation>
-  );
-};
-
-export default TPluginInstallModal;
-- 
cgit v1.2.3

