import { useProviderContext } from '@agentscope-ai/chat'; import Style from './styles'; import cls from 'classnames'; import { useChatAnywhereOptions } from '../Context/ChatAnywhereOptionsContext'; import { forwardRef, useContext } from 'react'; import Chat from '../Chat'; import Sessions from '../Sessions'; import { ChatAnyWhereLayoutContext } from '../Context/ChatAnywhereLayoutContext'; import Header from '../Header'; import React from 'react'; import Ref from '../Ref'; interface IProps { className?: string; left?: React.ReactNode; right?: React.ReactNode; } function Layout(props: IProps, ref: React.Ref) { const { className } = props; const prefixCls = useProviderContext().getPrefixCls('chat-anywhere-layout'); const narrowMode = useChatAnywhereOptions(v => v.theme.narrowMode); const background = useChatAnywhereOptions(v => v.theme.background); const rightHeader = useChatAnywhereOptions(v => v.theme.rightHeader); const { session } = useChatAnywhereOptions(v => ({ session: v.session })); const { collapsed } = useContext(ChatAnyWhereLayoutContext); const showLeft = !narrowMode && session && session.multiple && !session.hideBuiltInSessionList; return <>