()
const [isLoading, setIsLoading] = useState(false)
- const [paginationParams, setPaginationParams] = useState({
- count: 1,
- rowsPerPage: 10,
- page: 1
- })
useEffect(() => {
async function getPublished() {
- if (
- !account ||
- !accountId ||
- !ocean ||
- status !== OceanConnectionStatus.CONNECTED
- )
- return
+ if (!account || !accountId || !ocean) return
setIsLoading(true)
- const publishedItems = await getPublishedList(
- paginationParams.page,
- paginationParams.rowsPerPage
- )
- setPaginationParams({
- ...paginationParams,
- count: publishedItems.totalPages
- })
- const data = publishedItems.results.map((ddo) => {
- const { attributes } = ddo.findServiceByType('metadata')
- const { name, price, datePublished } = attributes.main as MetadataMain
- return {
- published: datePublished,
- name: name,
- price: price,
- id: ddo.id
- }
- })
+ // const queryResult = await
+
+ setQueryResult(queryResult)
- setPublishedList(data)
setIsLoading(false)
}
getPublished()
@@ -89,8 +26,8 @@ export default function PublishedList(): ReactElement {
return isLoading ? (
- ) : account && ocean ? (
-
+ ) : queryResult ? (
+
) : (
Connect your wallet to see your published data sets.
)
diff --git a/src/components/pages/History.tsx b/src/components/pages/History.tsx
index c86d92ef5..29c8257a5 100644
--- a/src/components/pages/History.tsx
+++ b/src/components/pages/History.tsx
@@ -8,7 +8,7 @@ import JobsList from '../organisms/JobsList'
const sections = [
{
title: 'Published',
- component: 'Coming Soon...'
+ component:
},
{
title: 'Downloaded',