Files
vercel__workflow/docs/components/geistdocs/mdx-components.tsx
Rich Haines aa93cc5e69 Migrate docs to package-backed geistdocs (#2222)
* Migrate docs to package-backed geistdocs

* update agent install cmd on home page

* add copy prompt component usage

* update docs test for sitemap inclusion

* cut unused components

* address docs migration review feedback

* address stale review feedback: geistdocs 1.8.2, version icons, cookbook prompts

* drop Workflow from OSS products dropdown (self-link)

* bump @vercel/geistdocs to 1.11.0

* fix: resolve pnpm-lock.yaml conflict marker from main merge

---------

Co-authored-by: Peter Wielander <peter.wielander@vercel.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
2026-07-13 18:44:11 +02:00

66 lines
1.8 KiB
TypeScript

import { Callout } from '@vercel/geistdocs/components/callout';
import { createMdxComponents } from '@vercel/geistdocs/mdx';
import { Step, Steps } from 'fumadocs-ui/components/steps';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';
import type { MDXComponents } from 'mdx/types';
import { AgentTraces } from '@/components/custom/agent-traces';
import { FluidComputeCallout } from '@/components/custom/fluid-compute-callout';
import { PreviewInstallServer } from '@/components/preview-install-server';
import * as AccordionComponents from '@/components/ui/accordion';
import { Badge } from '@/components/ui/badge';
import { WorldTestingPerformance as WorldTestingPerformanceView } from '@/components/worlds/WorldTestingPerformance';
import { TSDoc } from '@/lib/tsdoc';
import { getWorldData } from '@/lib/worlds-data';
const isPreview = process.env.VERCEL_ENV === 'preview';
const WorldTestingPerformance = async ({
worldId,
showBenchmarks = isPreview,
}: {
worldId?: string;
showBenchmarks?: boolean;
}) => {
if (!worldId) {
return (
<Callout type="warn">
World testing data is unavailable because no world ID was provided.
</Callout>
);
}
const data = await getWorldData(worldId);
if (!data) {
return (
<Callout type="warn">
World testing data is unavailable for <code>{worldId}</code>.
</Callout>
);
}
return (
<WorldTestingPerformanceView
worldId={worldId}
world={data.world}
meta={data.meta}
showBenchmarks={showBenchmarks}
/>
);
};
export const getMDXComponents = (components?: MDXComponents): MDXComponents =>
createMdxComponents({
AgentTraces,
FluidComputeCallout,
Badge,
TSDoc,
Step,
Steps,
...AccordionComponents,
Tabs,
Tab,
PreviewInstall: PreviewInstallServer,
WorldTestingPerformance,
...components,
});