aboutsummaryrefslogtreecommitdiff
path: root/apps/web/app/(dash)/layout.tsx
blob: 3ae4e76d32829e845860aca74b7807eb93e3d367 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import Header from "./header";
import Menu from "./menu";
import { redirect } from "next/navigation";
import { auth } from "../../server/auth";
import { Toaster } from "@repo/ui/shadcn/sonner";

async function Layout({ children }: { children: React.ReactNode }) {
  const info = await auth();

  if (!info) {
    return redirect("/signin");
  }

  return (
    <main className="h-screen flex flex-col">
      <div className="fixed top-0 left-0 w-full">
        <Header />
      </div>

      <Menu />

      <div className="w-full h-full px-2 md:px-0">{children}</div>

      <Toaster />
    </main>
  );
}

export default Layout;