forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexamples-carousel.tsx
More file actions
260 lines (253 loc) · 8.44 KB
/
Copy pathexamples-carousel.tsx
File metadata and controls
260 lines (253 loc) · 8.44 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
"use client";
import {
Card,
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Frame } from "@/components/react/frame";
import {
LuBookOpen,
LuBanknote,
LuPlane,
LuFileSpreadsheet,
LuCode,
LuExternalLink,
LuLightbulb,
} from "react-icons/lu";
import { badgeVariants } from "@/components/ui/badge";
import Link from "next/link";
import { cn } from "@/lib/utils";
import { Tabs, Tab } from "@/components/react/tabs";
import { YouTubeVideo } from "./youtube-video";
interface CarouselExample {
icon: React.ElementType;
title: string;
description: string;
media: {
type: "video" | "image" | "youtube";
src: string;
};
links: {
source?: string;
demo?: string;
tutorial?: string;
};
}
interface ExamplesCarouselProps {
id: string;
examples?: CarouselExample[];
}
const badgeStyles = cn(
badgeVariants({ variant: "outline" }),
"bg-indigo-500 hover:bg-indigo-600 text-white no-underline focus:ring-1 focus:ring-indigo-500",
);
export function ExamplesCarousel({
id,
examples = LandingExamples,
}: ExamplesCarouselProps) {
return (
<Tabs
groupId={id}
items={examples.map((example) => {
const Icon = example.icon;
return {
value: example.title,
icon: <Icon className="w-4 h-4" />,
};
})}
>
{examples.map((example, index) => {
const Icon = example.icon;
return (
<Tab key={index} value={example.title}>
<Card className="border-none shadow-none">
<CardHeader>
<CardTitle className="flex items-center text-xl">
<Icon className="mr-2" />
{example.title}
</CardTitle>
<div className="flex flex-wrap gap-2 my-2 pt-2">
{example.links.source && (
<Link
href={example.links.source}
target="_blank"
rel="noopener noreferrer"
className={badgeStyles}
>
<LuCode className="mr-2 h-3.5 w-3.5" />
Source
</Link>
)}
{example.links.demo && (
<Link
href={example.links.demo}
target="_blank"
rel="noopener noreferrer"
className={badgeStyles}
>
<LuExternalLink className="mr-2 h-3.5 w-3.5" />
Demo
</Link>
)}
{example.links.tutorial && (
<Link
href={example.links.tutorial}
target="_blank"
rel="noopener noreferrer"
className={badgeStyles}
>
<LuBookOpen className="mr-2 h-3.5 w-3.5" />
Tutorial
</Link>
)}
</div>
<CardDescription className="text-base pt-6 text-primary">
{example.description}
</CardDescription>
<div className="w-full">
{example.media.type === "video" && (
<video
autoPlay
loop
muted
controls
playsInline
src={example.media.src}
className="rounded-2xl shadow-xl border w-full h-auto"
/>
)}
{example.media.type === "image" && (
<Frame className="rounded-2xl shadow-xl">
<img
src={example.media.src}
className="w-full h-auto"
alt={example.title}
/>
</Frame>
)}
{example.media.type === "youtube" && (
<div className="flex justify-center mt-6">
<YouTubeVideo videoId={example.media.src} />
</div>
)}
</div>
</CardHeader>
</Card>
</Tab>
);
})}
</Tabs>
);
}
export const LandingExamples: CarouselExample[] = [
{
icon: LuFileSpreadsheet,
title: "Spreadsheet Copilot",
description:
"A powerful spreadsheet assistant that helps users analyze data, create formulas, and generate insights through natural language interaction.",
media: {
type: "video",
src: "https://cdn.copilotkit.ai/docs/copilotkit/images/examples/spreadsheets.mp4",
},
links: {
source:
"https://github.com/CopilotKit/CopilotKit/tree/main/examples/showcases/spreadsheet",
demo: "https://spreadsheet-demo-tau.vercel.app/",
},
},
{
icon: LuBanknote,
title: "Banking Assistant (SaaS Copilot)",
description:
"An AI-powered banking interface that helps users manage transactions, analyze spending patterns, and get personalized financial advice.",
media: {
type: "video",
src: "https://cdn.copilotkit.ai/docs/copilotkit/images/examples/banking.mp4",
},
links: {
source:
"https://github.com/CopilotKit/CopilotKit/tree/main/examples/showcases/banking",
demo: "https://brex-demo-temp.vercel.app/",
},
},
{
icon: LuPlane,
title: "Agent-Native Travel Planner (ANA)",
description:
"Interactive travel planning assistant that helps users discover destinations, create itineraries, and manage trip details with natural language.",
media: {
type: "video",
src: "https://cdn.copilotkit.ai/docs/copilotkit/images/langgraph/tutorials/ai-travel-app/demo.mp4",
},
links: {
source:
"https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-travel?ref=travel-tutorial",
demo: "https://examples-coagents-ai-travel-app.vercel.app/",
tutorial: "/langgraph/tutorials/ai-travel-app",
},
},
{
icon: LuBookOpen,
title: "Agent-Native Research Canvas (ANA)",
description:
"An intelligent research assistant that helps users analyze academic papers, synthesize information across multiple sources, and generate comprehensive research summaries.",
media: {
type: "video",
src: "https://cdn.copilotkit.ai/docs/copilotkit/images/examples/research.mp4",
},
links: {
source:
"https://github.com/CopilotKit/CopilotKit/blob/main/examples/coagents-research-canvas/readme.md",
demo: "https://examples-coagents-research-canvas-ui.vercel.app/",
tutorial: "/langgraph/videos/research-canvas",
},
},
];
export const CoAgentsExamples: CarouselExample[] = [
{
icon: LuLightbulb,
title: "Introduction",
description:
"Hear from the CEO of CopilotKit, Atai Barkai, and learn how CoAgents are paving the way for the next generation of AI-native apps.",
media: {
type: "youtube",
src: "tVjVYJE-Nic",
},
links: {
demo: "https://examples-coagents-research-canvas-ui.vercel.app/",
},
},
{
icon: LuPlane,
title: "Agent-Native Travel Planner (ANA)",
description:
"Interactive travel planning assistant that helps users discover destinations, create itineraries, and manage trip details with natural language.",
media: {
type: "video",
src: "https://cdn.copilotkit.ai/docs/copilotkit/images/langgraph/tutorials/ai-travel-app/demo.mp4",
},
links: {
source:
"https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-travel?ref=travel-tutorial",
demo: "https://examples-coagents-ai-travel-app.vercel.app/",
tutorial: "/langgraph/tutorials/ai-travel-app",
},
},
{
icon: LuBookOpen,
title: "Agent-Native Research Canvas (ANA)",
description:
"An intelligent research assistant that helps users analyze academic papers, synthesize information across multiple sources, and generate comprehensive research summaries.",
media: {
type: "video",
src: "https://cdn.copilotkit.ai/docs/copilotkit/images/examples/research.mp4",
},
links: {
source:
"https://github.com/CopilotKit/CopilotKit/blob/main/examples/coagents-research-canvas/readme.md",
demo: "https://examples-coagents-research-canvas-ui.vercel.app/",
tutorial: "/langgraph/videos/research-canvas",
},
},
];