xylabs/sdk-react

View on GitHub
packages/crypto/src/components/EthBlock.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { Box, Link, Typography } from '@mui/material'
import React from 'react'

interface EthAccountProps {
  block?: number
}

const EthBlock: React.FC<EthAccountProps> = (props: EthAccountProps) => {
  const { block } = props
  return block ?
      <Box alignItems="center" display="flex" flexGrow={1} justifyContent="center" paddingX={1}>
        <Link href={`https://etherscan.io/block/${block}`} target="_blank" title={`Ethereum Block #${block}`}>
          <Typography variant="caption">{block}</Typography>
        </Link>
      </Box>
    : <Box />
}

export { EthBlock }