From b8573a7894c36750b1ead4807c933056951256fe Mon Sep 17 00:00:00 2001 From: sherifButt <90522472+sherifButt@users.noreply.github.com> Date: Thu, 21 Mar 2024 06:36:25 +0000 Subject: [PATCH] added Meta Response Title Block above meta settings to discribe settings intent --- .../Generic/Blocks/TitleBlock/index.jsx | 2 +- .../src/components/WorkspaceChat/index.jsx | 5 +- .../WorkspaceSettings/MetaResponse/index.jsx | 95 +++++++++++-------- 3 files changed, 58 insertions(+), 44 deletions(-) diff --git a/frontend/src/components/Generic/Blocks/TitleBlock/index.jsx b/frontend/src/components/Generic/Blocks/TitleBlock/index.jsx index 8891b7f0..b4722094 100644 --- a/frontend/src/components/Generic/Blocks/TitleBlock/index.jsx +++ b/frontend/src/components/Generic/Blocks/TitleBlock/index.jsx @@ -24,7 +24,7 @@ export default function TitleBlock({
-
+
{Icon && }
diff --git a/frontend/src/components/WorkspaceChat/index.jsx b/frontend/src/components/WorkspaceChat/index.jsx index de8b3d2c..739d1b89 100644 --- a/frontend/src/components/WorkspaceChat/index.jsx +++ b/frontend/src/components/WorkspaceChat/index.jsx @@ -35,7 +35,10 @@ export default function WorkspaceChat({ loading, workspace }) { ); console.log("meta Response Settings:", metaResponseSettings); - if (Object.values(metaResponseSettings).some((settings) => settings.isEnabled) + if ( + Object.values(metaResponseSettings).some( + (settings) => settings.isEnabled + ) ) { chatHistory = chatHistory.map((message) => { if (message.role === "assistant") { diff --git a/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx b/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx index f928aa0c..599f8688 100644 --- a/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx +++ b/frontend/src/pages/WorkspaceSettings/MetaResponse/index.jsx @@ -1,9 +1,10 @@ import MetaResponse from "@/models/metaResponse"; import showToast from "@/utils/toast"; -import { ChatText, Heart, UserCircle } from "@phosphor-icons/react"; +import { ChatText, Cube, Heart, UserCircle } from "@phosphor-icons/react"; import { useEffect, useState } from "react"; import EnableFeatures from "./EnableFeatures"; import FeatureSettings from "./FeatureSettings"; +import TitleBlock from "@/components/Generic/Blocks/TitleBlock"; export default function MetaResponseSettings({ workspace }) { const [settings, setSettings] = useState({}); @@ -70,47 +71,57 @@ export default function MetaResponseSettings({ workspace }) { // }; return ( -
- {Object.keys(settings).map((feature) => { - const featureSettings = settings[feature]; - const IconComponent = mapIcons[feature]; - // const FeatureComponent = mapFeatures[feature]; - return ( -
- - workspace.metaResponse && - handleToggleEnableFeatures(feature, enabled) - } - disabled={!workspace.metaResponse} - Icon={IconComponent} - content={ - featureSettings.isEnabled && ( - - handleUpdateFeatureSettings( - feature, - updatedFeatureSettings - ) - } - /> - ) - } - bg={featureSettings.isEnabled} - /> -
- ); - })} +
+
+ +
+
+ {Object.keys(settings).map((feature) => { + const featureSettings = settings[feature]; + const IconComponent = mapIcons[feature]; + // const FeatureComponent = mapFeatures[feature]; + return ( +
+ + workspace.metaResponse && + handleToggleEnableFeatures(feature, enabled) + } + disabled={!workspace.metaResponse} + Icon={IconComponent} + content={ + featureSettings.isEnabled && ( + + handleUpdateFeatureSettings( + feature, + updatedFeatureSettings + ) + } + /> + ) + } + bg={featureSettings.isEnabled} + /> +
+ ); + })} +
); }