import { useSession } from "next-auth/react"; import React from "react"; import { useSID } from "../../hooks/useSID"; import type { ActiveTool } from "../../hooks/useTools"; import { useTools } from "../../hooks/useTools"; import Dialog from "../../ui/dialog"; import Button from "../Button"; import { Switch } from "../Switch"; export const ToolsDialog: React.FC<{ show: boolean; setOpen: (boolean) => void; }> = ({ show, setOpen }) => { const { activeTools, setToolActive, isSuccess } = useTools(); return ( } >

Select what external tools your agents have access to.

{activeTools.map((tool, i) => { if (tool.name === "sid") { return ; } return ; })} {!isSuccess &&

Error loading tools.

}
); }; interface ToolProps { tool: ActiveTool; onChange: (name: string, active: boolean) => void; } const GenericTool = ({ tool, onChange }: ToolProps) => { return (

{tool.name}

{tool.description}

onChange(tool.name, !tool.active)} />
); }; const SidTool = ({ tool, onChange }: ToolProps) => { const { data: session } = useSession(); const sid = useSID(session); return (
{!sid.connected && (
)}

{tool.name}

{tool.description}

{sid.connected && ( <> )}
onChange(tool.name, !tool.active)} />
); }; const ToolAvatar = ({ tool }: { tool: ActiveTool }) => { if (tool.image_url) { // eslint-disable-next-line @next/next/no-img-element return {tool.name}; } return
; };