import { getChats } from '@/app/actions' import { Session } from '@auth/core/types' import { SidebarItem } from './sidebar-item' export interface SidebarListProps { session?: Session } export async function SidebarList(props: SidebarListProps) { const chats = await getChats(props.session?.user?.email) return (
{chats?.length ? (
{chats.map(chat => ( ))}
) : (

{props?.session?.user ? ( <>No chat history ) : ( <>Login for history )}

)}
) } SidebarList.displayName = 'SidebarList'