import { useMemo, useState } from 'react'; import { Flex } from '@/components'; import { getRepositoryFromURL } from '@/utils'; import { IndexedNFA } from '../../indexed-nfa.context'; import { IndexedNFAStyles as S } from '../../indexed-nfa.styles'; import { Tab, TabContainer } from '../../tabs'; const OverviewFragment: React.FC = () => { const { nfa } = IndexedNFA.useContext(); return ( Token ID {nfa.tokenId} Network Mainnet Standard ERC_721 Description {nfa.description} ); }; const PropertiesFragment: React.FC = () => { const { nfa } = IndexedNFA.useContext(); const traitsToShow = useMemo(() => { return [ [nfa.ENS, 'ENS'], [getRepositoryFromURL(nfa.gitRepository.id), 'Repository'], [nfa.externalURL, 'Domain'], ]; }, [nfa]); return ( {traitsToShow.map(([value, label], index) => ( {value || '-'} {label} ))} ); }; export const TabFragment: React.FC = () => { const [tabSelected, setTabSelected] = useState(0); const handleClick = (index: number): void => { setTabSelected(index); }; return ( <> {['Overview', 'Properties'].map((label, index) => ( ))} {tabSelected === 0 ? : } ); };