feat: 用自定义侧边栏替换聊天室 Conversations 组件,提取公共 SidebarGroup 和 date-group

This commit is contained in:
2026-06-04 00:46:57 +08:00
parent dc7d9e83b8
commit f67cfa84ef
18 changed files with 1042 additions and 262 deletions

View File

@@ -0,0 +1,28 @@
import { CaretDownOutlined, CaretRightOutlined } from "@ant-design/icons";
import { Typography } from "antd";
import { type ReactNode, useState } from "react";
interface SidebarGroupProps {
children: ReactNode;
count: number;
label: string;
}
export function SidebarGroup({ children, count, label }: SidebarGroupProps) {
const [collapsed, setCollapsed] = useState(false);
return (
<div className="app-sidebar-group">
<div className="app-sidebar-group-header" onClick={() => setCollapsed(!collapsed)}>
<span className="app-sidebar-group-arrow">{collapsed ? <CaretRightOutlined /> : <CaretDownOutlined />}</span>
<Typography.Text className="app-sidebar-group-label" type="secondary">
{label}
</Typography.Text>
<Typography.Text className="app-sidebar-group-count" type="secondary">
({count})
</Typography.Text>
</div>
{!collapsed && <div className="app-sidebar-group-content">{children}</div>}
</div>
);
}