crush-level-web/src/app/(main)/character/[id]/chat/page.tsx

34 lines
959 B
TypeScript
Raw Normal View History

2025-12-11 11:31:56 +00:00
'use client';
2025-12-09 09:13:46 +00:00
2025-12-11 11:31:56 +00:00
import { IconButton } from '@/components/ui/button';
import Input from './Input';
import MessageList from './MessageList';
import { useChatStore } from './store';
import Sider from './Sider';
2025-12-09 09:13:46 +00:00
export default function ChatPage() {
2025-12-11 11:31:56 +00:00
const isSidebarOpen = useChatStore((store) => store.isSidebarOpen);
const setIsSidebarOpen = useChatStore((store) => store.setIsSidebarOpen);
2025-12-09 09:13:46 +00:00
return (
<div className="flex h-full">
<div className="relative w-full flex-1 flex justify-center">
<div className="max-w-[752px] w-full h-full flex flex-col">
<MessageList />
<Input />
</div>
<IconButton
onClick={() => setIsSidebarOpen(!isSidebarOpen)}
className="absolute top-1 right-1"
variant="ghost"
size="small"
>
<i className="iconfont-v2 iconv2-zhedie" />
</IconButton>
</div>
{isSidebarOpen && <Sider />}
</div>
2025-12-11 11:31:56 +00:00
);
2025-12-09 09:13:46 +00:00
}