/* eslint-disable eslint-comments/disable-enable-pair */ /* eslint-disable react-hooks/exhaustive-deps */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ /* eslint-disable @typescript-eslint/restrict-template-expressions */ import axios from 'axios' import { Alert } from 'components/Alert' import { Anchor } from 'components/Anchor' import { Conditional } from 'components/Conditional' import { ContractPageHeader } from 'components/ContractPageHeader' import { useWallet } from 'contexts/wallet' import type { NextPage } from 'next' import { NextSeo } from 'next-seo' import { useCallback, useEffect, useState } from 'react' import { FaRocket, FaSlidersH } from 'react-icons/fa' import { API_URL, STARGAZE_URL } from 'utils/constants' import { withMetadata } from 'utils/layout' import { links } from 'utils/links' const CollectionList: NextPage = () => { const wallet = useWallet() const [myCollections, setMyCollections] = useState([]) useEffect(() => { const fetchCollections = async () => { await axios .get(`${API_URL}/api/v1beta/collections/${wallet.address}`) .then((response) => { const collectionData = response.data setMyCollections(collectionData) }) .catch(console.error) } fetchCollections().catch(console.error) }, [wallet.address]) const renderTable = useCallback(() => { return (
{myCollections.length > 0 && ( {myCollections.map((collection: any, index: any) => { return ( ) })}
Collection Name Contract Address
Cover

{collection.name}

{collection.description}

{collection.contractAddress} {/*
*/} {/* */}
)}
) }, [myCollections, wallet.address]) return (

{renderTable()}

You haven't created any collections so far.
) } export default withMetadata(CollectionList, { center: false })