// app/workspaces/page.tsx import { redirect } from "next/navigation" import { getServerSession } from "next-auth" import { authOptions } from "@/lib/auth/config" import { prisma } from "@/lib/prisma" import Link from "next/link" export default async function WorkspacesPage() { const session = await getServerSession(authOptions) if (!session) { redirect("/login") } const user = await prisma.user.findUnique({ where: { id: session.user.id }, include: { workspacesAsEmployee: { where: { status: "ACTIVE" }, include: { manager: { select: { name: true, avatar: true, email: true } } } }, workspacesAsManager: { where: { status: "ACTIVE" }, include: { employee: { select: { name: true, avatar: true, email: true } } } } } }) return (
Selecione um workspace para acessar