@lifi/wallet-management
Version:
LI.FI Wallet Management solution.
32 lines • 1.46 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Avatar, Card, ListItemAvatar } from '@mui/material';
import { useTranslation } from 'react-i18next';
import { WalletTagType } from '../types/walletTagType.js';
import { ListItemText } from './ListItemText.js';
import { WalletTag } from './WalletTag.js';
export const CardListItemButton = ({ onClick, title, icon, tagType, }) => {
const { t } = useTranslation();
const getTagLabel = (tagType) => {
switch (tagType) {
case WalletTagType.Connected:
return t('tags.connected');
case WalletTagType.Multichain:
return t('tags.multichain');
case WalletTagType.Installed:
return t('tags.installed');
case WalletTagType.QrCode:
return t('tags.qrCode');
case WalletTagType.GetStarted:
return t('tags.getStarted');
default:
return '';
}
};
return (_jsxs(Card, { sx: {
display: 'flex',
flexDirection: 'row',
alignItems: 'center',
padding: 1.5,
}, onClick: onClick, children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: icon, alt: title, children: title[0] }) }), _jsx(ListItemText, { primary: title }), tagType && _jsx(WalletTag, { type: tagType, label: getTagLabel(tagType) })] }));
};
//# sourceMappingURL=CardListItemButton.js.map