"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const components_1 = require("@react-email/components");
const chain_1 = require("../_libs/chain");
const style_1 = require("../_libs/style");
function Asset({ locale, data, type = 'vc', }) {
    const title = { zh: '接收', en: 'Received' }[locale] || 'Received';
    const chainHost = (0, chain_1.getUrlHost)(data.chainHost) || (0, chain_1.getChainHost)(data.chainId);
    const url = `https://${chainHost}/explorer/assets/${data.did}`;
    return ((0, jsx_runtime_1.jsxs)("a", { href: url, target: "_blank", style: Object.assign(Object.assign({}, style_1.assetStyle), { margin: '1em 0', textDecoration: 'none', color: 'initial', display: 'block' }), onClick: (e) => {
            if (type === 'vc') {
                e.preventDefault();
                return;
            }
        }, children: [(0, jsx_runtime_1.jsxs)(components_1.Row, { style: style_1.titleStyle, children: [(0, jsx_runtime_1.jsx)(components_1.Column, { children: title }), (0, jsx_runtime_1.jsx)(components_1.Column, { align: "right", style: style_1.summaryStyle, children: "+1 Asset" })] }), (0, jsx_runtime_1.jsx)(components_1.Text, { style: style_1.remarkStyle, children: data.did })] }));
}
exports.default = Asset;
