@@ -2,7 +2,7 @@ import { connection } from "next/server";
22import { Suspense } from "react" ;
33import { PageTemplate } from "@/components/common/page-template" ;
44import { DashboardSkeleton } from "@/components/dashboard/dashboard-skeleton" ;
5- import { DbInitializer } from "@/components/dashboard/db-initializer " ;
5+ import { DatabaseSetupPanel } from "@/components/setup/database-setup-panel " ;
66import { Badge } from "@/components/ui/badge" ;
77import { getInitData } from "@/lib/getInitData" ;
88import DashboardClientPage from "./client-page" ;
@@ -15,100 +15,7 @@ const DashboardData = async () => {
1515 if ( ! dbStatus . ready ) {
1616 return (
1717 < >
18- < div className = "mt-4 rounded-lg border bg-card shadow-sm" >
19- { dbStatus . error === "ERROR_ENV_VAR_DATABASE_URL_NOT_SET" && (
20- < div className = "p-6 border-b" >
21- < h3 className = "font-bold text-2xl mb-2 tracking-tight" >
22- Database not configured
23- </ h3 >
24- < p className = "mb-4 text-muted-foreground" >
25- The{ " " }
26- < span className = "font-mono text-foreground bg-muted px-1.5 py-0.5 rounded text-sm" >
27- DATABASE_URL
28- </ span > { " " }
29- environment variable is not set. Add it to your{ " " }
30- < span className = "font-mono text-foreground bg-muted px-1.5 py-0.5 rounded text-sm" >
31- .env
32- </ span > { " " }
33- file to continue.
34- </ p >
35-
36- < div className = "mt-6 space-y-4" >
37- < p className = "text-sm font-semibold uppercase tracking-wide text-muted-foreground" >
38- How to fix
39- </ p >
40-
41- < div className = "pl-4 border-l-2 border-primary/40" >
42- < p className = "font-medium mb-1" >
43- Option 1 — Vercel + Supabase integration
44- </ p >
45- < p className = "text-sm text-muted-foreground" >
46- Open{ " " }
47- < a
48- href = "https://app.supabase.com/project/_/settings/integrations"
49- className = "text-primary hover:underline font-medium"
50- >
51- Supabase Dashboard Integrations
52- </ a >
53- , verify your Vercel connection, toggle
54- “Development” on, then “Manage”
55- → “Resync environment variables”. Locally,
56- run{ " " }
57- < span className = "font-mono text-foreground bg-muted px-1.5 py-0.5 rounded text-xs" >
58- vercel link
59- </ span > { " " }
60- and{ " " }
61- < span className = "font-mono text-foreground bg-muted px-1.5 py-0.5 rounded text-xs" >
62- vercel env pull
63- </ span >
64- .
65- </ p >
66- </ div >
67-
68- < div className = "pl-4 border-l-2 border-primary/40" >
69- < p className = "font-medium mb-1" >
70- Option 2 — Add credentials manually
71- </ p >
72- < p className = "text-sm text-muted-foreground" >
73- Grab credentials from{ " " }
74- < a
75- href = "https://app.supabase.com/project/_/settings/api?showConnect=true"
76- className = "text-primary hover:underline font-medium"
77- >
78- Supabase API Settings
79- </ a > { " " }
80- (under “App Frameworks”), save to{ " " }
81- < span className = "font-mono text-foreground bg-muted px-1.5 py-0.5 rounded text-xs" >
82- .env
83- </ span >
84- , then run the SQL below in the{ " " }
85- < a
86- href = "https://app.supabase.com/project/_/sql/new"
87- className = "text-primary hover:underline font-medium"
88- >
89- Supabase SQL Editor
90- </ a >
91- .
92- </ p >
93- </ div >
94- </ div >
95- </ div >
96- ) }
97- { dbStatus . error ?. includes ( "Missing required tables" ) && (
98- < div className = "p-6 border-b" >
99- < h3 className = "font-bold text-2xl mb-2 tracking-tight" >
100- Database schema incomplete
101- </ h3 >
102- < p className = "text-muted-foreground" >
103- Missing tables:{ " " }
104- < span className = "font-mono text-foreground" >
105- { dbStatus . error ?. replace ( "Missing required tables: " , "" ) }
106- </ span >
107- </ p >
108- </ div >
109- ) }
110- < DbInitializer databaseConfigured = { dbStatus . databaseConfigured } />
111- </ div >
18+ < DatabaseSetupPanel dbStatus = { dbStatus } />
11219 < DashboardSkeleton className = "filter blur-[1px] pointer-events-none mt-6" />
11320 </ >
11421 ) ;
0 commit comments