mirror of https://github.com/msgbyte/tailchat
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
578 B
TypeScript
20 lines
578 B
TypeScript
import React from 'react';
|
|
import { NormalMessageList } from './NormalList';
|
|
import type { MessageListProps } from './types';
|
|
import { VirtualizedMessageList } from './VirtualizedList.new';
|
|
|
|
const useVirtualizedList = true; // 是否使用虚拟化列表
|
|
|
|
export const ChatMessageList: React.FC<MessageListProps> = React.memo(
|
|
(props) => {
|
|
return useVirtualizedList ? (
|
|
<div className="flex-1">
|
|
<VirtualizedMessageList {...props} />
|
|
</div>
|
|
) : (
|
|
<NormalMessageList {...props} />
|
|
);
|
|
}
|
|
);
|
|
ChatMessageList.displayName = 'ChatMessageList';
|