diff --git a/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx b/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx index d2cdad7f..938e31d5 100644 --- a/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx +++ b/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx @@ -1,12 +1,25 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { fn } from "storybook/test"; +import type { MessageMethod } from "@inspector/core/mcp/types.js"; import { HistoryControls } from "./HistoryControls"; +const SAMPLE_METHODS: MessageMethod[] = [ + "tools/call", + "tools/list", + "resources/read", + "resources/list", + "prompts/get", + "prompts/list", + "sampling/createMessage", + "elicitation/create", +]; + const meta: Meta = { title: "Groups/HistoryControls", component: HistoryControls, args: { searchText: "", + availableMethods: SAMPLE_METHODS, onSearchChange: fn(), onMethodFilterChange: fn(), }, diff --git a/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx b/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx index b5756c9d..32ba944d 100644 --- a/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx +++ b/clients/web/src/components/groups/HistoryControls/HistoryControls.tsx @@ -1,26 +1,18 @@ import { Select, Stack, TextInput, Title } from "@mantine/core"; - -const METHOD_OPTIONS = [ - "tools/call", - "tools/list", - "resources/read", - "resources/list", - "prompts/get", - "prompts/list", - "sampling/createMessage", - "elicitation/create", -]; +import type { MessageMethod } from "@inspector/core/mcp/types.js"; export interface HistoryControlsProps { searchText: string; - methodFilter?: string; + methodFilter?: MessageMethod; + availableMethods: MessageMethod[]; onSearchChange: (text: string) => void; - onMethodFilterChange: (method: string | undefined) => void; + onMethodFilterChange: (method: MessageMethod | undefined) => void; } export function HistoryControls({ searchText, methodFilter, + availableMethods, onSearchChange, onMethodFilterChange, }: HistoryControlsProps) { @@ -36,9 +28,11 @@ export function HistoryControls({ Filter by Method