@0xsequence/connect
Version:
Connect package for Sequence Web SDK
22 lines • 2.31 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.CryptoOption = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const design_system_1 = require("@0xsequence/design-system");
const SelectedIndicator_js_1 = require("./SelectedIndicator.js");
const CryptoOption = ({ currencyName, chainId, iconUrl, symbol, price, onClick, isSelected, showInsufficientFundsWarning = undefined, disabled }) => {
const onClickCard = () => {
if (!showInsufficientFundsWarning && !disabled) {
onClick();
}
};
return ((0, jsx_runtime_1.jsxs)(design_system_1.Card, { className: "flex w-full justify-between p-4 cursor-pointer", onClick: onClickCard, children: [(0, jsx_runtime_1.jsxs)("div", { className: "flex flex-row gap-3", children: [(0, jsx_runtime_1.jsx)("div", { className: "w-fit", children: (0, jsx_runtime_1.jsx)(design_system_1.TokenImage, { src: iconUrl, size: "lg", symbol: symbol, withNetwork: chainId, disableAnimation: true }) }), (0, jsx_runtime_1.jsxs)("div", { className: "flex flex-col justify-center", children: [(0, jsx_runtime_1.jsx)(design_system_1.Text, { className: "whitespace-nowrap", variant: "normal", fontWeight: "bold", color: "primary", ellipsis: true, style: {
overflow: 'hidden',
maxWidth: '215px'
}, children: currencyName }), price && ((0, jsx_runtime_1.jsx)(design_system_1.Text, { className: "whitespace-nowrap", variant: "normal", color: "muted", ellipsis: true, style: {
overflow: 'hidden',
width: '215px'
}, children: `${price} ${symbol}` }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: "flex flex-row justify-center items-center gap-3", children: showInsufficientFundsWarning ? ((0, jsx_runtime_1.jsx)("div", { className: "flex flex-col text-center justify-between items-end", children: (0, jsx_runtime_1.jsx)(design_system_1.Text, { variant: "small", color: "negative", children: "Insufficient funds" }) })) : ((0, jsx_runtime_1.jsx)(SelectedIndicator_js_1.SelectedIndicator, { selected: isSelected })) })] }));
};
exports.CryptoOption = CryptoOption;
//# sourceMappingURL=CryptoOption.js.map