'use client'; import ChatCard, { ChatCardLayout } from './ChatCard'; import { IconPlus } from '../ui/Icons'; import { auth } from '@/auth'; import { VariableSizeList as List } from 'react-window'; import { cleanInputMessage } from '@/lib/messageUtils'; import AutoSizer from 'react-virtualized-auto-sizer'; import { ChatWithMessages } from '@/lib/db/types'; export interface ChatSidebarListProps { chats: ChatWithMessages[]; isAdminView?: boolean; } const getItemSize = (message: string, isAdminView?: boolean) => { if (message.length >= 45) return 116; else if (message.length >= 20) return 104; else return 88; }; export default function ChatSidebarList({ chats, isAdminView, }: ChatSidebarListProps) { return ( <> {!isAdminView && (
New chat