TypeScript 97.5%
SQL 1.4%
Python 0.8%
1import Link from "next/link";2import { MailWarning } from "lucide-react";3import { getWorkspace } from "@/lib/session";4import { Sidebar } from "@/components/dashboard/sidebar";5import { Topbar } from "@/components/dashboard/topbar";6import { ResendVerificationButton } from "@/components/dashboard/resend-verification";78export const dynamic = "force-dynamic";910export default async function DashboardLayout({ children }: { children: React.ReactNode }) {11 const ws = await getWorkspace();12 return (13 <div className="flex min-h-dvh">14 <Sidebar isAdmin={ws.isAdmin} />15 <div className="flex min-w-0 flex-1 flex-col">16 <Topbar17 user={{ name: ws.user.name, email: ws.user.email, image: ws.user.image }}18 organization={{ id: ws.organization.id, name: ws.organization.name, plan: ws.organization.plan }}19 projects={ws.projects.map((p) => ({ id: p.id, name: p.name, environment: p.environment }))}20 currentProjectId={ws.project.id}21 isAdmin={ws.isAdmin}22 />23 {!ws.user.emailVerified ? (24 <div className="flex flex-wrap items-center gap-3 border-b border-warning/30 bg-warning-soft px-4 py-2 text-[13px] sm:px-6">25 <MailWarning className="size-4 text-warning" aria-hidden />26 <span>27 Verify <strong>{ws.user.email}</strong> to unlock production API access. The Playground works while you wait.28 </span>29 <ResendVerificationButton email={ws.user.email} />30 <Link href="/dashboard/settings" className="ml-auto text-fg-muted underline-offset-4 hover:underline">Change email</Link>31 </div>32 ) : null}33 <main className="flex-1 px-4 py-6 sm:px-6 lg:px-8 lg:py-8">34 <div className="mx-auto w-full max-w-[1200px] animate-fade-in">{children}</div>35 </main>36 </div>37 </div>38 );39}40