diff --git a/frontend/src/settings/ToolConfig.tsx b/frontend/src/settings/ToolConfig.tsx index 0be3a776..6adcd77e 100644 --- a/frontend/src/settings/ToolConfig.tsx +++ b/frontend/src/settings/ToolConfig.tsx @@ -1,5 +1,4 @@ import React from 'react'; - import userService from '../api/services/userService'; import ArrowLeft from '../assets/arrow-left.svg'; import CircleCheck from '../assets/circle-check.svg'; @@ -7,9 +6,11 @@ import CircleX from '../assets/circle-x.svg'; import Trash from '../assets/trash.svg'; import Dropdown from '../components/Dropdown'; import Input from '../components/Input'; +import ToggleSwitch from '../components/ToggleSwitch'; import AddActionModal from '../modals/AddActionModal'; import { ActiveState } from '../models/misc'; import { APIActionType, APIToolType, UserToolType } from './types'; +import { useTranslation } from 'react-i18next'; export default function ToolConfig({ tool, @@ -25,7 +26,7 @@ export default function ToolConfig({ ); const [actionModalState, setActionModalState] = React.useState('INACTIVE'); - + const { t } = useTranslation(); const handleCheckboxChange = (actionIndex: number, property: string) => { setTool({ ...tool, @@ -134,16 +135,13 @@ export default function ToolConfig({ {Object.keys(tool?.config).length !== 0 && tool.name !== 'api_tool' && (
- - API Key / Oauth - setAuthKey(e.target.value)} borderVariant="thin" - placeholder="Enter API Key / Oauth" - > + placeholder={t('modals.configTool.apiKeyPlaceholder')} + />
)}
@@ -192,33 +190,27 @@ export default function ToolConfig({

{action.name}

- + { + setTool({ + ...tool, + actions: tool.actions.map((act, index) => { + if (index === actionIndex) { + return { ...act, active: checked }; + } + return act; + }), + }); + }} + size="small" + id={`actionToggle-${actionIndex}`} + />
-
+
{ @@ -236,7 +228,7 @@ export default function ToolConfig({ }); }} borderVariant="thin" - > + />
@@ -431,19 +423,12 @@ function APIToolConfig({

{action.name}

- + handleActionToggle(actionName)} + size="small" + id={`actionToggle-${actionIndex}`} + />