diff --git a/frontend/src/components/CommunityHub/PublishEntityModal/index.jsx b/frontend/src/components/CommunityHub/PublishEntityModal/index.jsx index 97a24188c..c5167b11c 100644 --- a/frontend/src/components/CommunityHub/PublishEntityModal/index.jsx +++ b/frontend/src/components/CommunityHub/PublishEntityModal/index.jsx @@ -68,19 +68,52 @@ export default function PublishEntityModal({ ); } +function successCopy(entityType, t) { + switch (entityType) { + case "system-prompt": + return { + title: t("community_hub.publish.system_prompt.success_title"), + description: t( + "community_hub.publish.system_prompt.success_description" + ), + thankYou: t("community_hub.publish.system_prompt.success_thank_you"), + viewOnHub: t("community_hub.publish.system_prompt.view_on_hub"), + }; + case "agent-flow": + return { + title: t("community_hub.publish.agent_flow.success_title"), + description: t("community_hub.publish.agent_flow.success_description"), + thankYou: t("community_hub.publish.agent_flow.success_thank_you"), + viewOnHub: t("community_hub.publish.agent_flow.view_on_hub"), + }; + case "slash-command": + return { + title: t("community_hub.publish.slash_command.success_title"), + description: t( + "community_hub.publish.slash_command.success_description" + ), + thankYou: t("community_hub.publish.slash_command.success_thank_you"), + viewOnHub: t("community_hub.publish.slash_command.view_on_hub"), + }; + default: + return null; + } +} + function PublishSuccess({ entityType, itemId }) { const { t } = useTranslation(); - const key = entityType.replace("-", "_"); + const copy = successCopy(entityType, t); + if (!copy) return null; return (

- {t(`community_hub.publish.${key}.success_title`)} + {copy.title}

- {t(`community_hub.publish.${key}.success_description`)} + {copy.description}

- {t(`community_hub.publish.${key}.success_thank_you`)} + {copy.thankYou}

- {t(`community_hub.publish.${key}.view_on_hub`)} + {copy.viewOnHub}
);