import { Button, Popconfirm, Space, Table } from "antd"; import type { TrustContent } from "@personal-brand/api-client"; import type { TrustTypeOption } from "../domain/trust-content-domain.js"; import { getTrustContentPreview } from "../domain/trust-content-domain.js"; import { MutationError } from "../../../components/QueryState.js"; import { StatusTag } from "../../../components/StatusTag.js"; export function TrustContentTable({ availableTypes, items, removeError, removePending, onEdit, onDelete, }: { availableTypes: TrustTypeOption[]; items: TrustContent[]; removeError: unknown; removePending: boolean; onEdit: (item: TrustContent) => void; onDelete: (id: string) => void; }) { return (
( item.type === value)?.label ?? String(value)} /> ), }, { title: "标题", dataIndex: "title" }, { title: "内容预览", ellipsis: { showTitle: true }, render: (_value: unknown, item: TrustContent) => getTrustContentPreview( item, availableTypes.find((type) => type.type === item.type), ), }, { title: "发布状态", dataIndex: "isPublished", render: (value) => ( ), }, { title: "操作", render: (_: unknown, item: TrustContent) => ( onDelete(item.id)} > ), }, ]} /> ); }