OnchainAddressDisplay.tsx raw

   1  function OnchainAddressDisplay({ address }: { address: string }) {
   2    return (
   3      <>
   4        {address.match(/.{1,4}/g)?.map((word, index) => {
   5          if (index % 2 === 0) {
   6            return (
   7              <span key={index} className="text-foreground">
   8                {word}
   9              </span>
  10            );
  11          } else {
  12            return (
  13              <span key={index} className="text-muted-foreground">
  14                {word}
  15              </span>
  16            );
  17          }
  18        })}
  19      </>
  20    );
  21  }
  22  
  23  export default OnchainAddressDisplay;
  24