import React from 'react'; import Exit from '../assets/exit.svg'; import Input from '../components/Input'; import { ActiveState } from '../models/misc'; import { AvailableTool } from './types'; import userService from '../api/services/userService'; export default function ConfigToolModal({ modalState, setModalState, tool, getUserTools, }: { modalState: ActiveState; setModalState: (state: ActiveState) => void; tool: AvailableTool | null; getUserTools: () => void; }) { const [authKey, setAuthKey] = React.useState(''); const handleAddTool = (tool: AvailableTool) => { userService .createTool({ name: tool.name, displayName: tool.displayName, description: tool.description, config: { token: authKey }, actions: tool.actions, status: true, }) .then(() => { setModalState('INACTIVE'); getUserTools(); }); }; return (

Tool Config

Type: {tool?.name}

API Key / Oauth setAuthKey(e.target.value)} borderVariant="thin" placeholder="Enter API Key / Oauth" >
); }