import { redirect } from "next/navigation"; import { ModeToggle } from "@/components/mode-toggle"; import { ScrollArea } from "@/components/ui/scroll-area"; import { Separator } from "@/components/ui/separator"; import { currentProfile } from "@/lib/current-profile"; import { db } from "@/lib/db"; import { NavigationAction } from "./navigation-action"; import { NavigationItem } from "./navigation-item"; import { UserButton } from "@clerk/nextjs"; export const NavigationSidebar = async () => { const profile = await currentProfile(); if (!profile) { return redirect("/"); } const servers = await db.server.findMany({ where: { members: { some: { profileId: profile.id, }, }, }, }) return (
{servers.map((server) => (
))}
) }