"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.VerifyCodeEmail = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
const components_1 = require("@react-email/components");
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 VerifyCodeEmail = ({ code, magicLink, appInfo, locale = 'en', userInfo, poweredBy, signatureConfig, theme, }) => {
    var _a, _b, _c;
    const fontFamily = ((_a = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _a === void 0 ? void 0 : _a.fontFamily) || 'HelveticaNeue,Helvetica,Arial,sans-serif';
    const h1FontFamily = ((_c = (_b = theme === null || theme === void 0 ? void 0 : theme.typography) === null || _b === void 0 ? void 0 : _b.h1) === null || _c === void 0 ? void 0 : _c.fontFamily) || fontFamily;
    const main = {
        fontFamily,
    };
    const translations = {
        en: {
            title: `Sign in to ${appInfo.title}`,
        },
        zh: {
            title: `登录 ${appInfo.title}`,
        },
    };
    const translation = translations[locale] || translations.en;
    const subject = `[${appInfo.title}] ${translation.title}`;
    return ((0, jsx_runtime_1.jsxs)(layout_1.default, { mainStyle: main, subject: subject, theme: theme, 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.title, body: (0, jsx_runtime_1.jsx)(verify_code_body_1.default, { locale: locale, code: code, magicLink: magicLink, appName: appInfo.title }), fontFamily: fontFamily, h1FontFamily: h1FontFamily }), (0, jsx_runtime_1.jsx)(footer_1.default, { showCopyright: false, poweredBy: poweredBy, showBlocklet: true, appInfo: appInfo, locale: locale, userInfo: userInfo, signatureConfig: signatureConfig, fontFamily: fontFamily })] }));
};
exports.VerifyCodeEmail = VerifyCodeEmail;
exports.default = exports.VerifyCodeEmail;
