"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.KycCodeVerifyEmail = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const components_1 = require("@react-email/components");
// @ts-ignore
const constant_1 = require("@abtnode/constant");
const footer_1 = __importDefault(require("../_components/footer"));
const content_1 = __importDefault(require("../_components/content"));
const layout_1 = __importDefault(require("../_components/layout"));
const header_1 = __importDefault(require("../_components/header"));
const verify_code_body_1 = __importDefault(require("./verify-code-body"));
const style_1 = require("../_libs/style");
const fontFamily = 'HelveticaNeue,Helvetica,Arial,sans-serif';
const main = {
    fontFamily,
};
const KycCodeVerifyEmail = ({ code, appInfo, locale = 'en', userInfo, poweredBy, signatureConfig, }) => {
    const appName = appInfo.title;
    const ttl = constant_1.VERIFY_CODE_TTL / 60 / 1000;
    const translations = {
        en: {
            emailTitle: `Verify Your Email for ${appName}`,
            emailHeadline: 'To ensure the security of your account and enhance your experience, you need to use following code to verify your email, and you will receive a NFT in your DID Wallet upon verification.',
            emailValidCode: `This code is valid for ${ttl} minutes. If you don't want to verify your email, you can ignore this message.`,
            emailWarning: `${appName} will never email you and ask you to disclose your password, credit card, or banking account number.`,
        },
        zh: {
            emailTitle: `验证您在 ${appName} 的邮箱`,
            emailHeadline: '为确保您的帐户安全并增强您的体验，您需要使用以下代码验证您的邮箱，并在验证后在您的 DID Wallet 中收到 NFT。',
            emailValidCode: `此代码有效期为 ${ttl} 分钟。如果您不想验证您的邮箱，您可以忽略此消息。`,
            emailWarning: `${appName} 永远不会向您发送电子邮件并要求您披露您的密码、信用卡或银行账户信息。`,
        },
    };
    const translation = translations[locale] || translations.en;
    const subject = `[${appInfo.title}] ${translation.emailTitle}`;
    return ((0, jsx_runtime_1.jsxs)(layout_1.default, { mainStyle: main, subject: subject, children: [(0, jsx_runtime_1.jsx)(components_1.Preview, { children: subject }), (0, jsx_runtime_1.jsx)(header_1.default, { appInfo: appInfo }), (0, jsx_runtime_1.jsx)(content_1.default, { style: style_1.contentStyle, locale: locale, title: translation.emailTitle, body: (0, jsx_runtime_1.jsx)(verify_code_body_1.default, { locale: locale, code: code, appName: appInfo.title, children: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(components_1.Text, { children: translation.emailHeadline }), (0, jsx_runtime_1.jsx)(components_1.Heading, { style: { textAlign: 'center', margin: '1.1em 0' }, children: code }), (0, jsx_runtime_1.jsx)(components_1.Text, { children: translation.emailValidCode }), (0, jsx_runtime_1.jsx)(components_1.Text, { children: translation.emailWarning })] }) }) }), (0, jsx_runtime_1.jsx)(footer_1.default, { showCopyright: false, poweredBy: poweredBy, showBlocklet: true, appInfo: appInfo, locale: locale, userInfo: userInfo, signatureConfig: signatureConfig })] }));
};
exports.KycCodeVerifyEmail = KycCodeVerifyEmail;
exports.default = exports.KycCodeVerifyEmail;
