Add create team page

This commit is contained in:
KMKoushik
2024-04-30 21:31:54 +10:00
parent b352210185
commit 7996a8e373
6 changed files with 215 additions and 27 deletions

View File

@@ -31,6 +31,7 @@ import { Sheet, SheetContent, SheetTrigger } from "@unsend/ui/src/sheet";
import { NextAuthProvider } from "~/providers/next-auth";
import { getServerAuthSession } from "~/server/auth";
import { NavButton } from "./nav-button";
import { db } from "~/server/db";
export const metadata = {
title: "Unsend",
@@ -53,6 +54,16 @@ export default async function AuthenticatedDashboardLayout({
redirect("/wait-list");
}
const teamUser = await db.teamUser.findFirst({
where: {
userId: session.user.id,
},
});
if (!teamUser) {
redirect("/create-team");
}
return (
<NextAuthProvider session={session}>
<div className="flex min-h-screen w-full h-full">