forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagentcore-command-tabs.tsx
More file actions
52 lines (48 loc) · 1.37 KB
/
Copy pathagentcore-command-tabs.tsx
File metadata and controls
52 lines (48 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"use client";
import { Tabs, Tab } from "fumadocs-ui/components/tabs";
import { CodeBlock, Pre } from "fumadocs-ui/components/codeblock";
interface AgentCoreCommandTabsProps {
framework?: "langgraph" | "strands";
lgCommand: string;
stCommand: string;
}
/**
* Renders a framework-aware Tabs code block.
* - No framework: shows both LangGraph and Strands tabs.
* - framework="langgraph": shows only the LangGraph tab.
* - framework="strands": shows only the Strands tab.
*/
export function AgentCoreCommandTabs({
framework,
lgCommand,
stCommand,
}: AgentCoreCommandTabsProps) {
const items =
framework === "langgraph"
? ["LangGraph"]
: framework === "strands"
? ["Strands"]
: ["LangGraph", "Strands"];
return (
<Tabs groupId="agentcore-framework" items={items}>
{(framework === "langgraph" || !framework) && (
<Tab value="LangGraph">
<CodeBlock data-language="bash">
<Pre>
<code className="language-bash ml-4"> {lgCommand}</code>
</Pre>
</CodeBlock>
</Tab>
)}
{(framework === "strands" || !framework) && (
<Tab value="Strands">
<CodeBlock data-language="bash">
<Pre>
<code className="language-bash ml-4">{stCommand}</code>
</Pre>
</CodeBlock>
</Tab>
)}
</Tabs>
);
}