import React, { useMemo, useRef } from 'react'; import { ChatHeader } from './ChatHeader'; import { ChatContent } from './ChatContent'; import { useScroll } from 'ahooks'; interface ChatContainerProps {} export const ChatContainer = React.memo( React.forwardRef((props, ref) => { const chatContentRef = useRef(null); const scroll = useScroll(chatContentRef); const showScrollOverflow = useMemo(() => { if (!chatContentRef.current || !scroll) return false; const trigger = 25; return scroll.top > trigger; }, [chatContentRef, scroll?.top]); return (
); }) ); ChatContainer.displayName = 'ChatContainer';