|
1 | 1 | "use client";
|
2 | 2 |
|
3 | 3 | import { EmbeddedWidgetComponent } from "./components/EmbeddedWidgetComponent";
|
4 |
| -import styles from "./page.module.css"; |
5 | 4 |
|
6 | 5 | export default function Home() {
|
7 | 6 | const handleWidgetEvent = (event: any) => {
|
8 | 7 | console.log("Widget event handled in Home component:", event);
|
9 | 8 | };
|
10 | 9 |
|
11 | 10 | return (
|
12 |
| - <div className={styles.container}> |
13 |
| - <header className={styles.header}> |
14 |
| - <h1 className={styles.heading}>Airbyte Embedded Widget</h1> |
| 11 | + <div className="min-h-screen bg-gradient-to-br from-indigo-50 via-blue-50 to-indigo-100 flex flex-col"> |
| 12 | + <header className="w-full py-10 shadow-md mb-12 border-b border-indigo-100"> |
| 13 | + <div className="max-w-2xl mx-auto flex flex-col items-center px-6"> |
| 14 | + <h1 className="text-5xl font-black text-indigo-700 tracking-tight drop-shadow-sm mb-2 text-center"> |
| 15 | + Airbyte Embedded Widget |
| 16 | + </h1> |
| 17 | + <p className="text-lg text-indigo-400 font-medium text-center"> |
| 18 | + A beautiful developer playground for your widget |
| 19 | + </p> |
| 20 | + </div> |
15 | 21 | </header>
|
16 | 22 |
|
17 |
| - <div className={styles.widgetContainer}> |
18 |
| - <p className={styles.note}>Click the button below to open the Airbyte widget.</p> |
19 |
| - <div className={styles.buttonContainer}> |
20 |
| - <EmbeddedWidgetComponent onEvent={handleWidgetEvent} /> |
| 23 | + <main className="flex-1 flex flex-col items-center justify-center px-2 pb-12"> |
| 24 | + <div className=" p-10 rounded-3xl shadow-2xl w-full max-w-lg text-center mb-12 border border-indigo-100 transition-all duration-300"> |
| 25 | + <p className="text-base opacity-90 mb-8 text-gray-700"> |
| 26 | + Click the button below to open the Airbyte widget. |
| 27 | + </p> |
| 28 | + <div className="flex justify-center mt-2"> |
| 29 | + <EmbeddedWidgetComponent onEvent={handleWidgetEvent} /> |
| 30 | + </div> |
21 | 31 | </div>
|
22 |
| - </div> |
23 | 32 |
|
24 |
| - <div className={styles.envContainer}> |
25 |
| - <h2 className={styles.headingSmall}>Environment Variables:</h2> |
26 |
| - <EnvVar label="NEXT_PUBLIC_WORKSPACE_ID" value={process.env.NEXT_PUBLIC_WORKSPACE_ID} /> |
27 |
| - <EnvVar label="NEXT_PUBLIC_CLIENT_ID" value={process.env.NEXT_PUBLIC_CLIENT_ID} /> |
28 |
| - <EnvVar |
29 |
| - label="NEXT_PUBLIC_CLIENT_SECRET" |
30 |
| - value={process.env.NEXT_PUBLIC_CLIENT_SECRET ? "******" : "Not set"} |
31 |
| - /> |
32 |
| - <EnvVar label="NEXT_PUBLIC_BASE_URL" value={process.env.NEXT_PUBLIC_BASE_URL} /> |
33 |
| - <p className={styles.envNote}> |
34 |
| - Note: Environment variables must be prefixed with <code>NEXT_PUBLIC_</code> to be visible on the client side. |
35 |
| - </p> |
36 |
| - </div> |
| 33 | + <div className="w-full max-w-lg border border-indigo-100 p-8 rounded-2xl bg-white/90 shadow-lg"> |
| 34 | + <h2 className="text-xl font-bold mb-6 text-indigo-700 flex items-center gap-2"> |
| 35 | + <span className="inline-block w-3 h-3 bg-indigo-400 rounded-full animate-pulse" /> |
| 36 | + Environment Variables |
| 37 | + </h2> |
| 38 | + <div className="space-y-3 mb-4"> |
| 39 | + <EnvVar |
| 40 | + label="NEXT_PUBLIC_WORKSPACE_ID" |
| 41 | + value={process.env.NEXT_PUBLIC_WORKSPACE_ID} |
| 42 | + /> |
| 43 | + <EnvVar label="NEXT_PUBLIC_CLIENT_ID" value={process.env.NEXT_PUBLIC_CLIENT_ID} /> |
| 44 | + <EnvVar |
| 45 | + label="NEXT_PUBLIC_CLIENT_SECRET" |
| 46 | + value={process.env.NEXT_PUBLIC_CLIENT_SECRET ? "******" : "Not set"} |
| 47 | + /> |
| 48 | + <EnvVar label="NEXT_PUBLIC_BASE_URL" value={process.env.NEXT_PUBLIC_BASE_URL} /> |
| 49 | + </div> |
| 50 | + <p className="mt-3 text-xs text-gray-500 text-left"> |
| 51 | + <span className="font-semibold text-indigo-500">Note:</span> Environment variables must be prefixed with{" "} |
| 52 | + <code className="bg-indigo-50 px-1 rounded text-indigo-700">NEXT_PUBLIC_</code> to be visible on the client side. |
| 53 | + </p> |
| 54 | + </div> |
| 55 | + </main> |
37 | 56 | </div>
|
38 | 57 | );
|
39 | 58 | }
|
40 | 59 |
|
41 |
| -function EnvVar({ label, value }: { label: string; value: string | undefined }) { |
| 60 | +function EnvVar({ |
| 61 | + label, |
| 62 | + value, |
| 63 | +}: { |
| 64 | + label: string; |
| 65 | + value: string | undefined; |
| 66 | +}) { |
42 | 67 | return (
|
43 |
| - <div> |
44 |
| - <b>{label}:</b> {value || "Not set"} |
| 68 | + <div className="flex items-center justify-between bg-indigo-50/80 px-4 py-2 rounded-lg text-base border border-indigo-100"> |
| 69 | + <span className="font-semibold text-indigo-800 tracking-wide">{label}:</span> |
| 70 | + <span className="ml-3 text-gray-700 font-mono break-all">{value || "Not set"}</span> |
45 | 71 | </div>
|
46 | 72 | );
|
47 | 73 | }
|
0 commit comments