import React from 'react'; import PropTypes from 'prop-types'; import { useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import Box from '../../ui/box'; import Button from '../../ui/button'; import Typography from '../../ui/typography/typography'; import NftsDetectionNotice from '../nfts-detection-notice'; import NftsItems from '../nfts-items'; import { TypographyVariant, TextAlign, JustifyContent, FLEX_DIRECTION, FontWeight, AlignItems, TextColor, } from '../../../helpers/constants/design-system'; import { useI18nContext } from '../../../hooks/useI18nContext'; import { getIsMainnet, getUseNftDetection } from '../../../selectors'; import { EXPERIMENTAL_ROUTE } from '../../../helpers/constants/routes'; import { checkAndUpdateAllNftsOwnershipStatus, detectNfts, } from '../../../store/actions'; import { useNftsCollections } from '../../../hooks/useNftsCollections'; import ZENDESK_URLS from '../../../helpers/constants/zendesk-url'; export default function NftsTab({ onAddNFT }) { const useNftDetection = useSelector(getUseNftDetection); const isMainnet = useSelector(getIsMainnet); const history = useHistory(); const t = useI18nContext(); const dispatch = useDispatch(); const { nftsLoading, collections, previouslyOwnedCollection } = useNftsCollections(); const onEnableAutoDetect = () => { history.push(EXPERIMENTAL_ROUTE); }; const onRefresh = () => { if (isMainnet) { dispatch(detectNfts()); } checkAndUpdateAllNftsOwnershipStatus(); }; if (nftsLoading) { return