import { getChats } from '@/app/actions' import { SidebarItem } from '@/components/sidebar-item' import { LoginButton } from '@/components/login-button' export interface SidebarListProps { userId?: string } export async function SidebarList({ userId }: SidebarListProps) { if (!userId) { return (

You are not logged in!

Please login for chat history.

) } const chats = await getChats(userId) return (
{chats?.length ? (
{chats.map(chat => ( ))}
) : (

No chat history

)}
) } SidebarList.displayName = 'SidebarList'