1+ "use client"
2+
3+ import { Card , CardDescription , CardHeader , CardTitle } from "@/components/ui/card" ;
4+ import { Frame } from "@/components/react/frame" ;
5+ import { LuBookOpen , LuBanknote , LuPlane , LuFileSpreadsheet , LuCode , LuExternalLink , LuLightbulb } from "react-icons/lu" ;
6+ import { badgeVariants } from "@/components/ui/badge" ;
7+ import Link from "next/link" ;
8+ import { cn } from "@/lib/utils" ;
9+ import { Tabs , Tab } from "@/components/react/tabs" ;
10+ import { YouTubeVideo } from "./youtube-video" ;
11+
12+ interface CarouselExample {
13+ icon : React . ElementType ;
14+ title : string ;
15+ description : string ;
16+ media : {
17+ type : 'video' | 'image' | 'youtube' ;
18+ src : string ;
19+ } ;
20+ links : {
21+ source ?: string ;
22+ demo ?: string ;
23+ tutorial ?: string ;
24+ } ;
25+ }
26+
27+ interface ExamplesCarouselProps {
28+ examples ?: CarouselExample [ ] ;
29+ }
30+
31+ const badgeStyles = cn ( badgeVariants ( { variant : "outline" } ) , "bg-indigo-500 hover:bg-indigo-600 text-white no-underline focus:ring-1 focus:ring-indigo-500" ) ;
32+
33+ export function ExamplesCarousel ( { examples = LandingExamples } : ExamplesCarouselProps ) {
34+ return (
35+ < Tabs items = {
36+ examples . map ( ( example ) => {
37+ const Icon = example . icon ;
38+ return {
39+ value : example . title ,
40+ icon : < Icon className = "w-4 h-4" />
41+ }
42+ } )
43+ } >
44+ { examples . map ( ( example , index ) => {
45+ const Icon = example . icon ;
46+ return (
47+ < Tab key = { index } value = { example . title } >
48+ < Card className = "border-none shadow-none" >
49+ < CardHeader >
50+ < CardTitle className = "flex items-center text-xl" >
51+ < Icon className = "mr-2" />
52+ { example . title }
53+ </ CardTitle >
54+ < div className = "flex flex-wrap gap-2 my-2 pt-2" >
55+ { example . links . source && (
56+ < Link
57+ href = { example . links . source }
58+ target = "_blank"
59+ rel = "noopener noreferrer"
60+ className = { badgeStyles }
61+ >
62+ < LuCode className = "mr-2 h-3.5 w-3.5" />
63+ Source
64+ </ Link >
65+ ) }
66+ { example . links . demo && (
67+ < Link
68+ href = { example . links . demo }
69+ target = "_blank"
70+ rel = "noopener noreferrer"
71+ className = { badgeStyles }
72+ >
73+ < LuExternalLink className = "mr-2 h-3.5 w-3.5" />
74+ Demo
75+ </ Link >
76+ ) }
77+ { example . links . tutorial && (
78+ < Link
79+ href = { example . links . tutorial }
80+ target = "_blank"
81+ rel = "noopener noreferrer"
82+ className = { badgeStyles }
83+ >
84+ < LuBookOpen className = "mr-2 h-3.5 w-3.5" />
85+ Tutorial
86+ </ Link >
87+ ) }
88+ </ div >
89+ < CardDescription className = "text-base pt-6 text-primary" >
90+ { example . description }
91+ </ CardDescription >
92+ < div className = "w-full" >
93+ { example . media . type === 'video' && (
94+ < video
95+ autoPlay
96+ loop
97+ muted
98+ controls
99+ playsInline
100+ src = { example . media . src }
101+ className = "rounded-2xl shadow-xl border w-full h-auto"
102+ />
103+ ) }
104+ { example . media . type === 'image' && (
105+ < Frame className = "rounded-2xl shadow-xl" >
106+ < img src = { example . media . src } className = "w-full h-auto" />
107+ </ Frame >
108+ ) }
109+ { example . media . type === 'youtube' && (
110+ < div className = "flex justify-center mt-6" >
111+ < YouTubeVideo videoId = { example . media . src } />
112+ </ div >
113+ ) }
114+ </ div >
115+ </ CardHeader >
116+ </ Card >
117+ </ Tab >
118+ ) ;
119+ } ) }
120+ </ Tabs >
121+ ) ;
122+ }
123+
124+ export const LandingExamples : CarouselExample [ ] = [
125+ {
126+ icon : LuFileSpreadsheet ,
127+ title : "Spreadsheet Copilot" ,
128+ description : "A powerful spreadsheet assistant that helps users analyze data, create formulas, and generate insights through natural language interaction." ,
129+ media : {
130+ type : "video" ,
131+ src : "/images/examples/spreadsheets.mp4"
132+ } ,
133+ links : {
134+ source : "https://github.com/CopilotKit/demo-spreadsheet" ,
135+ demo : "https://spreadsheet-demo-tau.vercel.app/" ,
136+ }
137+ } ,
138+ {
139+ icon : LuBanknote ,
140+ title : "Banking Assistant (SaaS Copilot)" ,
141+ description : "An AI-powered banking interface that helps users manage transactions, analyze spending patterns, and get personalized financial advice." ,
142+ media : {
143+ type : "video" ,
144+ src : "/images/examples/banking.mp4"
145+ } ,
146+ links : {
147+ source : "https://github.com/CopilotKit/demo-banking" ,
148+ demo : "https://brex-demo-temp.vercel.app/" ,
149+ }
150+ } ,
151+ {
152+ icon : LuPlane ,
153+ title : "Agent-Native Travel Planner (ANA)" ,
154+ description : "Interactive travel planning assistant that helps users discover destinations, create itineraries, and manage trip details with natural language." ,
155+ media : {
156+ type : "video" ,
157+ src : "/images/coagents/tutorials/ai-travel-app/demo.mp4"
158+ } ,
159+ links : {
160+ source : "https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-travel?ref=travel-tutorial" ,
161+ demo : "https://examples-coagents-ai-travel-app.vercel.app/" ,
162+ tutorial : "/coagents/tutorials/ai-travel-app"
163+ }
164+ } ,
165+ {
166+ icon : LuBookOpen ,
167+ title : "Agent-Native Research Canvas (ANA)" ,
168+ description : "An intelligent research assistant that helps users analyze academic papers, synthesize information across multiple sources, and generate comprehensive research summaries." ,
169+ media : {
170+ type : "video" ,
171+ src : "/images/examples/research.mp4"
172+ } ,
173+ links : {
174+ source : "https://github.com/CopilotKit/CopilotKit/blob/main/examples/coagents-research-canvas/readme.md" ,
175+ demo : "https://examples-coagents-research-canvas-ui.vercel.app/" ,
176+ tutorial : "/coagents/videos/research-canvas"
177+ }
178+ }
179+ ] ;
180+
181+ export const CoAgentsExamples : CarouselExample [ ] = [
182+ {
183+ icon : LuLightbulb ,
184+ title : "Introduction" ,
185+ 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." ,
186+ media : {
187+ type : "youtube" ,
188+ src : "tVjVYJE-Nic"
189+ } ,
190+ links : {
191+ demo : "https://examples-coagents-research-canvas-ui.vercel.app/" ,
192+ }
193+ } ,
194+ {
195+ icon : LuPlane ,
196+ title : "Agent-Native Travel Planner (ANA)" ,
197+ description : "Interactive travel planning assistant that helps users discover destinations, create itineraries, and manage trip details with natural language." ,
198+ media : {
199+ type : "video" ,
200+ src : "/images/coagents/tutorials/ai-travel-app/demo.mp4"
201+ } ,
202+ links : {
203+ source : "https://github.com/CopilotKit/CopilotKit/tree/main/examples/coagents-travel?ref=travel-tutorial" ,
204+ demo : "https://examples-coagents-ai-travel-app.vercel.app/" ,
205+ tutorial : "/coagents/tutorials/ai-travel-app"
206+ }
207+ } ,
208+ {
209+ icon : LuBookOpen ,
210+ title : "Agent-Native Research Canvas (ANA)" ,
211+ description : "An intelligent research assistant that helps users analyze academic papers, synthesize information across multiple sources, and generate comprehensive research summaries." ,
212+ media : {
213+ type : "video" ,
214+ src : "/images/examples/research.mp4"
215+ } ,
216+ links : {
217+ source : "https://github.com/CopilotKit/CopilotKit/blob/main/examples/coagents-research-canvas/readme.md" ,
218+ demo : "https://examples-coagents-research-canvas-ui.vercel.app/" ,
219+ tutorial : "/coagents/videos/research-canvas"
220+ }
221+ }
222+ ]
0 commit comments