feat: [US-011] - Dashboard layout with navbar

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Gustavo Henrique Santos Souza de Miranda
2026-01-21 04:11:01 -03:00
co-authored by Claude Opus 4.5
parent fae8cd7764
commit 0f8a9546b5
2 changed files with 60 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
import { redirect } from 'next/navigation'
import { createClient } from '@/lib/supabase/server'
import Navbar from '@/components/Navbar'
export default async function DashboardLayout({
children,
}: {
children: React.ReactNode
}) {
const supabase = await createClient()
const {
data: { user },
} = await supabase.auth.getUser()
if (!user) {
redirect('/login')
}
return (
<div className="min-h-screen bg-zinc-50 dark:bg-zinc-950">
<Navbar userEmail={user.email || ''} />
<main className="mx-auto max-w-7xl px-4 py-8 sm:px-6 lg:px-8">
{children}
</main>
</div>
)
}