feat(workbench): 新增收集箱页面 — 素材列表/详情分栏布局 + 新增/选中/删除 mock 交互
This commit is contained in:
39
src/web/features/inbox/components/MaterialList.tsx
Normal file
39
src/web/features/inbox/components/MaterialList.tsx
Normal file
@@ -0,0 +1,39 @@
|
||||
import { PlusOutlined } from "@ant-design/icons";
|
||||
import { Button, Empty } from "antd";
|
||||
|
||||
import type { Material } from "../types";
|
||||
|
||||
import { MaterialCard } from "./MaterialCard";
|
||||
|
||||
interface MaterialListProps {
|
||||
materials: readonly Material[];
|
||||
onAddClick: () => void;
|
||||
onDelete: (id: string) => void;
|
||||
onSelect: (id: string) => void;
|
||||
selectedId: null | string;
|
||||
}
|
||||
|
||||
export function MaterialList({ materials, onAddClick, onDelete, onSelect, selectedId }: MaterialListProps) {
|
||||
return (
|
||||
<div className="app-inbox-sidebar">
|
||||
<Button block icon={<PlusOutlined />} onClick={onAddClick} type="primary">
|
||||
新增素材
|
||||
</Button>
|
||||
<div className="app-inbox-list">
|
||||
{materials.length === 0 ? (
|
||||
<Empty description="暂无素材" image={Empty.PRESENTED_IMAGE_SIMPLE} />
|
||||
) : (
|
||||
materials.map((material) => (
|
||||
<MaterialCard
|
||||
key={material.id}
|
||||
material={material}
|
||||
onDelete={() => onDelete(material.id)}
|
||||
onSelect={() => onSelect(material.id)}
|
||||
selected={material.id === selectedId}
|
||||
/>
|
||||
))
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user