-
-
+}) => {
+ const [actions, setActions] = useState
([]);
+ const [reactions, setReactions] = useState
([]);
+ const { t } = useTranslation();
+
+ useEffect(() => {
+ (async () => {
+ const actionsResponse = await services.services.getServiceActions(service.id);
+ const reactionsResponse = await services.services.getServiceReactions(service.id);
+
+ setActions(actionsResponse.data ?? []);
+ setReactions(reactionsResponse.data ?? []);
+ })();
+ }, []);
+
+ return (
+
+
setSelectedServiceId(service.id)}
+ />
+
+
+
+ {actions.length > 0 && (
+ <>
+
{t("services.actions")}
+
+ {actions.map((action) => (
+ -
+
{action.id}
+ {action.description}
+
+ ))}
+
+ >
+ )}
+ {reactions.length > 0 && (
+ <>
+
{t("services.reactions")}
+
+ {reactions.map((reaction) => (
+ -
+
{reaction.id}
+ {reaction.description}
+
+ ))}
+
+ >
+ )}
+
+ {actions.length === 0 && reactions.length === 0 && (
+
{t("services.noArea")}
+ )}
-
{service.id}
-
-
-
TODO: Actions and Reactions displayed
-
-);
+ );
+};
const ServicesPage = () => {
const [cachedServices, setCachedServices] = useAtom(servicesAtom);
diff --git a/frontend/web/components/editor/ServicesList.tsx b/frontend/web/components/editor/ServicesList.tsx
index d6794dc4..cb24d50f 100644
--- a/frontend/web/components/editor/ServicesList.tsx
+++ b/frontend/web/components/editor/ServicesList.tsx
@@ -1,4 +1,5 @@
import Image from "next/image";
+
import { Service } from "@/types/services";
import { splitArrayInChunks } from "@/utils/arrays";
diff --git a/frontend/web/locales/en-US.ts b/frontend/web/locales/en-US.ts
index 86c906b9..0ff86641 100644
--- a/frontend/web/locales/en-US.ts
+++ b/frontend/web/locales/en-US.ts
@@ -67,6 +67,11 @@ const translations = {
logout: "Logout",
},
},
+ services: {
+ actions: "Actions",
+ reactions: "Reactions",
+ noArea: "This service doesn't have any action or reaction",
+ },
landing: {
actions: {
downloadApk: " Download APK",
diff --git a/frontend/web/locales/fr-FR.ts b/frontend/web/locales/fr-FR.ts
index 1a9350d0..dd754be8 100644
--- a/frontend/web/locales/fr-FR.ts
+++ b/frontend/web/locales/fr-FR.ts
@@ -67,6 +67,11 @@ const translations = {
logout: "Déconnexion",
},
},
+ services: {
+ actions: "Actions",
+ reactions: "Réactions",
+ noArea: "Ce service n'a pas d'action ou de réaction",
+ },
landing: {
actions: {
downloadApk: " Télécharger l'APK",
diff --git a/frontend/web/locales/is-IS.ts b/frontend/web/locales/is-IS.ts
index d59789b2..816c891e 100644
--- a/frontend/web/locales/is-IS.ts
+++ b/frontend/web/locales/is-IS.ts
@@ -67,6 +67,11 @@ const translations = {
logout: "Aftengdu",
},
},
+ services: {
+ actions: "Aðgerðir",
+ reactions: "Viðbrögð",
+ noArea: "Þessi þjónusta hefur engar aðgerðir eða viðbrögð",
+ },
landing: {
actions: {
downloadApk: " Sækja APK",