import React from "react";
// eslint-disable-next-line @typescript-eslint/no-var-requires
var style = require("./defaultcert.module.css");
export var DefaultTemplate = function (props) {
    var json = props.document;
    var issuedDate = json["issuedOn"];
    var formattedDate = "";
    var d = new Date(issuedDate);
    var timestamp = Date.parse(issuedDate);
    if (issuedDate == "<issued date>") {
        formattedDate = issuedDate;
    }
    else if (isNaN(timestamp) == false) {
        var dtf = new Intl.DateTimeFormat("en", { year: "numeric", month: "short", day: "2-digit" });
        var _a = dtf.formatToParts(d), mo = _a[0].value, da = _a[2].value, ye = _a[4].value;
        formattedDate = da + " " + mo + " " + ye;
    }
    return (React.createElement("div", { className: style["cert-template"] },
        React.createElement("div", { className: style["cert-content"] },
            React.createElement("p", { className: style["default-cert-text"] }, "The design of this certificate is used for illustration purposes only. Please verify your certificate at the issuer\u2019s site."),
            React.createElement("h1", { className: style["cert-name"] }, json["name"]),
            React.createElement("p", { className: style["cert-info"] },
                "This certificate is given to",
                React.createElement("span", { className: style["receipient-name"] }, json["recipient"]["name"]),
                "for successfully completing all requirements required by the",
                React.createElement("br", null),
                json["name"]),
            React.createElement("div", { className: style["default-date"] },
                React.createElement("span", { className: style["default-issued-date"] }, formattedDate),
                React.createElement("hr", { className: style["default-sig-line"] }),
                React.createElement("span", { className: style["default-date-text"] }, "Date Attained")),
            React.createElement("span", { className: style["cert-id"] }, json["id"]))));
};
export var defaultTemplate = {
    id: "default-template",
    label: "Certificate",
    template: DefaultTemplate,
};
//# sourceMappingURL=DefaultTemplate.js.map