diff --git a/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx b/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx index d2cdad7f..ed24eabc 100644 --- a/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx +++ b/clients/web/src/components/groups/HistoryControls/HistoryControls.stories.tsx @@ -2,11 +2,23 @@ import type { Meta, StoryObj } from "@storybook/react-vite"; import { fn } from "storybook/test"; import { HistoryControls } from "./HistoryControls"; +const SAMPLE_METHODS = [ + "tools/call", + "tools/list", + "resources/read", + "resources/list", + "prompts/get", + "prompts/list", + "sampling/createMessage", + "elicitation/create", +] as const; + 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..1fc6add8 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 { RequestMethod } from "@inspector/core/mcp/types.js"; export interface HistoryControlsProps { searchText: string; - methodFilter?: string; + methodFilter?: RequestMethod; + availableMethods: RequestMethod[]; onSearchChange: (text: string) => void; - onMethodFilterChange: (method: string | undefined) => void; + onMethodFilterChange: (method: RequestMethod | undefined) => void; } export function HistoryControls({ searchText, methodFilter, + availableMethods, onSearchChange, onMethodFilterChange, }: HistoryControlsProps) { @@ -36,9 +28,11 @@ export function HistoryControls({ Filter by Method