|
1 | 1 | "use client"; |
2 | 2 |
|
3 | | -import { useEffect, useState } from "react"; |
| 3 | +import { useEffect } from "react"; |
4 | 4 | import { ExampleLayout } from "@/components/example-layout"; |
5 | 5 | import { useGenerativeUIExamples, useExampleSuggestions } from "@/hooks"; |
6 | 6 | import { ExplainerCardsPortal } from "@/components/explainer-cards"; |
7 | | -import { DemoGallery, type DemoItem } from "@/components/demo-gallery"; |
8 | | - |
9 | 7 | import { CopilotChat } from "@copilotkit/react-core/v2"; |
10 | | -import { useCopilotChat } from "@copilotkit/react-core"; |
11 | 8 |
|
12 | 9 | export default function HomePage() { |
13 | 10 | useGenerativeUIExamples(); |
14 | 11 | useExampleSuggestions(); |
15 | 12 |
|
16 | | - const [demoDrawerOpen, setDemoDrawerOpen] = useState(false); |
17 | | - const { appendMessage } = useCopilotChat(); |
18 | | - |
19 | | - const handleTryDemo = (demo: DemoItem) => { |
20 | | - setDemoDrawerOpen(false); |
21 | | - // eslint-disable-next-line @typescript-eslint/no-explicit-any |
22 | | - appendMessage({ content: demo.prompt, role: "user" } as any); |
23 | | - }; |
24 | | - |
25 | 13 | // Widget bridge: handle messages from widget iframes |
26 | 14 | useEffect(() => { |
27 | 15 | const handler = (e: MessageEvent) => { |
@@ -67,25 +55,6 @@ export default function HomePage() { |
67 | 55 | </p> |
68 | 56 | </div> |
69 | 57 | <div className="flex items-center gap-2"> |
70 | | - <button |
71 | | - onClick={() => setDemoDrawerOpen(true)} |
72 | | - className="inline-flex items-center gap-1.5 px-3 py-2 rounded-full text-sm font-medium no-underline whitespace-nowrap transition-all duration-150 hover:-translate-y-px cursor-pointer" |
73 | | - style={{ |
74 | | - color: "var(--text-secondary)", |
75 | | - border: "1px solid var(--color-border-glass, rgba(0,0,0,0.1))", |
76 | | - background: "var(--surface-primary, rgba(255,255,255,0.6))", |
77 | | - fontFamily: "var(--font-family)", |
78 | | - }} |
79 | | - title="Open Demo Gallery" |
80 | | - > |
81 | | - <svg width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round"> |
82 | | - <rect width="7" height="7" x="3" y="3" rx="1" /> |
83 | | - <rect width="7" height="7" x="14" y="3" rx="1" /> |
84 | | - <rect width="7" height="7" x="14" y="14" rx="1" /> |
85 | | - <rect width="7" height="7" x="3" y="14" rx="1" /> |
86 | | - </svg> |
87 | | - Demos |
88 | | - </button> |
89 | 58 | <a |
90 | 59 | href="https://github.com/CopilotKit/OpenGenerativeUI" |
91 | 60 | target="_blank" |
@@ -114,11 +83,6 @@ export default function HomePage() { |
114 | 83 | </div> |
115 | 84 | </div> |
116 | 85 |
|
117 | | - <DemoGallery |
118 | | - open={demoDrawerOpen} |
119 | | - onClose={() => setDemoDrawerOpen(false)} |
120 | | - onTryDemo={handleTryDemo} |
121 | | - /> |
122 | 86 | </> |
123 | 87 | ); |
124 | 88 | } |
0 commit comments