import { NextChatLogo } from "@/components/ui/nextchat-logo"; import { Login } from "@/components/ui/login"; import { UserMenu } from "@/components/ui/user-menu"; import { prisma } from "@/lib/prisma"; import { type Session } from "@/lib/session/types"; import { cn } from "@/lib/utils"; import { Plus } from "lucide-react"; import Link from "next/link"; import { SidebarItem } from "./sidebar-item"; export interface SidebarProps { session?: Session; newChat?: boolean; } export function Sidebar({ session, newChat }: SidebarProps) { return (
); } Sidebar.displayName = "Sidebar"; async function SidebarList({ session }: { session?: Session }) { const chats = await prisma.chat.findMany({ where: { // This is for debugging, need to add scope to the query later // userId: session?.user.id, }, orderBy: { updatedAt: "desc", }, }); return chats.map((c) => ( )); }