xylabs/sdk-react

View on GitHub
packages/crypto/src/wallets/components/Overview/CardHeader.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import { CheckCircleOutline } from '@mui/icons-material'
import { CardHeader, CardHeaderProps } from '@mui/material'
import { EthAddress } from '@xylabs/eth-address'

import { ConstrainedImage } from '../shared'

export interface WalletOverviewCardHeaderProps extends CardHeaderProps {
  currentAccount?: EthAddress
  icon?: string
  walletName?: string
}

export const WalletOverviewCardHeader: React.FC<WalletOverviewCardHeaderProps> = ({ currentAccount, icon, walletName, ...props }) => {
  return (
    <CardHeader
      avatar={<ConstrainedImage constrainedValue={'42px'} src={icon} />}
      title={walletName}
      action={currentAccount ? <CheckCircleOutline color="success" /> : null}
      {...props}
    />
  )
}