diff --git a/src/pages/Resource.tsx b/src/pages/Resource.tsx index 3744c3b..841e441 100644 --- a/src/pages/Resource.tsx +++ b/src/pages/Resource.tsx @@ -21,6 +21,7 @@ import { import { useGetItemById } from '../hooks/useGetItemById'; import { useGetItemRelationWithAddr } from '../hooks/useGetItemRelationWithAddr'; import { reportEvent } from '../utils/ga'; +import { NoData } from '../components/NoData'; /** * Have been listed @@ -29,26 +30,13 @@ import { reportEvent } from '../utils/ga'; */ const Resource = () => { const [p] = useSearchParams(); - // const groupId = p.getAll('gid')[0]; - // const cid = p.getAll('cid')[0]; - // const objectId = p.get('oid') as string; - // const gName = p.getAll('gn')[0]; - // const bGroupName = p.getAll('bgn')[0]; const itemId = p.get('id') as string; - // const bucketId = p.getAll('bid')[0] - const { address } = useAccount(); const { data: itemInfo, isLoading: itemInfoLoading } = useGetItemById( parseInt(itemId), ); - // console.log('p.getAll(oid)', p.get('oid'), p.get('id')); - // console.log('objectId: ', objectId); - - // const { data: xx } = useGfGetObjInfo(objectId); - // console.log('xx', xx); - const relation = useGetItemRelationWithAddr(address, itemInfo); const storageInfo = useGetBOInfoFromGroup(itemInfo?.groupName); @@ -73,16 +61,14 @@ const Resource = () => { : `${bucketData.bucketInfo.bucketName} #${itemInfo?.name}`; }, [bucketData, itemInfo, storageInfo]); - // console.log('itemInfo', itemInfo); - // console.log('storageInfo', storageInfo); - // console.log('groupData', groupData); - // console.log('bucketData', bucketData); - // console.log('objectData', objectData); - - if (itemInfoLoading || !itemInfo || !bucketData) { + if (itemInfoLoading) { return ; } + if (!itemInfo || !bucketData) { + return ; + } + return (