fix type errors
This commit is contained in:
@@ -40,7 +40,7 @@ import NotificationsTab from "./components/NotificationsTab";
|
||||
import PromptsTab, { Prompt } from "./components/PromptsTab";
|
||||
import ToolsTab from "./components/ToolsTab";
|
||||
import History from "./components/History";
|
||||
import { AnyZodObject } from "node_modules/zod/lib";
|
||||
import { AnyZodObject } from "zod";
|
||||
|
||||
const App = () => {
|
||||
const [connectionStatus, setConnectionStatus] = useState<
|
||||
|
||||
@@ -5,11 +5,6 @@ import { TabsContent } from "@/components/ui/tabs";
|
||||
import { Resource } from "mcp-typescript/types.js";
|
||||
import ListPane from "./ListPane";
|
||||
|
||||
export type Resource = {
|
||||
uri: string;
|
||||
name: string;
|
||||
};
|
||||
|
||||
const ResourcesTab = ({
|
||||
resources,
|
||||
listResources,
|
||||
@@ -38,7 +33,7 @@ const ResourcesTab = ({
|
||||
renderItem={(resource) => (
|
||||
<div className="flex items-center w-full">
|
||||
<FileText className="w-4 h-4 mr-2 flex-shrink-0 text-gray-500" />
|
||||
<span className="flex-1 truncate" title={resource.uri}>
|
||||
<span className="flex-1 truncate" title={resource.uri.toString()}>
|
||||
{resource.name}
|
||||
</span>
|
||||
<ChevronRight className="w-4 h-4 flex-shrink-0 text-gray-400" />
|
||||
|
||||
@@ -61,7 +61,7 @@ const ToolsTab = ({
|
||||
<p className="text-sm text-gray-600">
|
||||
{selectedTool.description}
|
||||
</p>
|
||||
{Object.entries(selectedTool.inputSchema.properties).map(
|
||||
{Object.entries(selectedTool.inputSchema.properties ?? []).map(
|
||||
([key, value]) => (
|
||||
<div key={key}>
|
||||
<Label
|
||||
@@ -71,14 +71,17 @@ const ToolsTab = ({
|
||||
{key}
|
||||
</Label>
|
||||
<Input
|
||||
// @ts-expect-error value type is currently unknown
|
||||
type={value.type === "number" ? "number" : "text"}
|
||||
id={key}
|
||||
name={key}
|
||||
// @ts-expect-error value type is currently unknown
|
||||
placeholder={value.description}
|
||||
onChange={(e) =>
|
||||
setParams({
|
||||
...params,
|
||||
[key]:
|
||||
// @ts-expect-error value type is currently unknown
|
||||
value.type === "number"
|
||||
? Number(e.target.value)
|
||||
: e.target.value,
|
||||
|
||||
Reference in New Issue
Block a user