| 1 | import { Header } from "@/components/layout/header"; |
| 2 | import { auth } from "@/server/auth"; |
| 3 | import { redirect } from "next/navigation"; |
| 4 | import { ReactNode } from "react"; |
| 5 | |
| 6 | interface DashboardLayoutProps { |
| 7 | children: ReactNode; |
| 8 | } |
| 9 | |
| 10 | export default async function DashboardLayout({ |
| 11 | children, |
| 12 | }: DashboardLayoutProps) { |
| 13 | const session = await auth(); |
| 14 | if (!session?.user) { |
| 15 | redirect("/login"); |
| 16 | } |
| 17 | |
| 18 | return ( |
| 19 | <div className="min-h-[calc(100vh-64px-56px)]"> |
| 20 | <Header /> |
| 21 | <div className="container max-w-6xl mx-auto py-10 px-4 md:px-8"> |
| 22 | {children} |
| 23 | </div> |
| 24 | </div> |
| 25 | ); |
| 26 | } |