diff --git a/src/web/features/inbox/components/MaterialCard.tsx b/src/web/features/inbox/components/MaterialCard.tsx index e09f303..44310d0 100644 --- a/src/web/features/inbox/components/MaterialCard.tsx +++ b/src/web/features/inbox/components/MaterialCard.tsx @@ -1,7 +1,7 @@ import { DeleteOutlined } from "@ant-design/icons"; -import { Button, Card, Flex, Popconfirm, Typography } from "antd"; +import { Button, Flex, Popconfirm, Tag, Typography } from "antd"; -import type { Material } from "../types"; +import type { Material, MaterialStatus } from "../types"; interface MaterialCardProps { material: Material; @@ -10,34 +10,55 @@ interface MaterialCardProps { selected: boolean; } -export function MaterialCard({ material, onDelete, onSelect }: MaterialCardProps) { +const STATUS_MAP: Record = { + approved: { color: "green", label: "已通过" }, + discarded: { color: "red", label: "已放弃" }, + pending: { color: "gold", label: "待审核" }, +}; + +export function MaterialCard({ material, onDelete, onSelect, selected }: MaterialCardProps) { + const statusInfo = STATUS_MAP[material.status]; + const className = selected ? "material-list-item material-list-item--selected" : "material-list-item"; + return ( - - {material.description} - - {formatMaterialTime(material.createdAt)} - e?.stopPropagation()} - onConfirm={(e) => { - e?.stopPropagation(); - onDelete(); - }} - title="确认删除该素材?" - > -