Skip to main content
Glama

Storyden

by Southclaws
Mozilla Public License 2.0
229
LibraryFeedScreen.tsx1.93 kB
"use client"; import { Unready } from "src/components/site/Unready"; import { useNodeGet, useNodeList } from "@/api/openapi-client/nodes"; import { NodeListResult } from "@/api/openapi-schema"; import { NodeCardGrid, NodeCardRows } from "@/components/library/NodeCardList"; import { EmptyState } from "@/components/site/EmptyState"; import { useSettingsContext } from "@/components/site/SettingsContext/SettingsContext"; import { LibraryPageScreen } from "@/screens/library/LibraryPageScreen/LibraryPageScreen"; export type Props = { initialData?: NodeListResult; }; export function LibraryFeedScreen({ initialData }: Props) { const { feed } = useSettingsContext(); if (feed.source.type !== "library") { return null; } if (feed.source.node) { return ( <LibraryFeedNode initialData={initialData} nodeID={feed.source.node} /> ); } return <LibraryFeedRoot initialData={initialData} />; } function LibraryFeedNode({ initialData, nodeID }: Props & { nodeID: string }) { const { data, error } = useNodeGet( nodeID, {}, { // swr: { fallbackData: initialData }, }, ); if (!data) { return <Unready error={error} />; } return ( <LibraryPageScreen node={data} //childNodes={[]} // TODO: Replicate LibraryPageScreen behavior /> ); } function LibraryFeedRoot({ initialData }: Props) { const { feed } = useSettingsContext(); const { data, error } = useNodeList( { // }, { swr: { fallbackData: initialData }, }, ); if (!data) { return <Unready error={error} />; } if (data.nodes.length === 0) { return <EmptyState />; } switch (feed.layout.type) { case "grid": return ( <NodeCardGrid libraryPath={[]} nodes={data.nodes} context="library" /> ); case "list": return ( <NodeCardRows libraryPath={[]} nodes={data.nodes} context="library" /> ); } }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Southclaws/storyden'

If you have feedback or need assistance with the MCP directory API, please join our Discord server