import { useEffect, useState } from 'react'; import { useParams } from 'react-router-dom'; import { Alert, Card, Collapse, Descriptions, Spin, Table, Tag, Typography } from 'antd'; import type { CollectionItemInspection } from '@atlas/contracts'; import { collectionApi } from '@/services/collection'; import { apiErrorMessage } from '@/services/api'; /** Temporary parser inspection surface. This is deliberately read-only: it lets * product and parser work be checked before these values become editor fields. */ export default function CollectionInspectionPage() { const { id } = useParams<{ id: string }>(); const [record, setRecord] = useState(); const [error, setError] = useState(); useEffect(() => { if (!id) return; void collectionApi.inspection(id).then(setRecord).catch((reason) => setError(apiErrorMessage(reason))); }, [id]); if (error) return ; if (!record) return
; return 只读测试}> SKU 草稿 value ?? '默认 SKU(待确认)' }, { title: '来源货号', dataIndex: 'source_sku', render: (value) => value ?? '—' }, { title: '名称', dataIndex: 'display_name', render: (value) => value ?? '—' }, ]} /> 素材转存任务
查看来源 }, { title: '错误', dataIndex: 'error_payload', render: (value) => value ? {JSON.stringify(value)} : '—' }, ]} /> }, { key: 'evidence', label: '原始证据(raw_evidence)', children: }, ]} /> ; } function Json({ value }: { value: unknown }) { return
{JSON.stringify(value, null, 2)}
; }