'use strict';
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
    result["default"] = mod;
    return result;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
require("../../stylesheets/attachments/footer.scss");
const React = __importStar(require("react"));
const moment_1 = __importDefault(require("moment"));
const parseTs = ts => {
    if (!ts)
        return '';
    if (ts && ts === 'NOW')
        return moment_1.default().format('MMM Do, YYYY [at] H:mm A');
    ts = moment_1.default(parseInt(ts, 10));
    if (!ts.isValid())
        return '';
    return ts.format('MMM Do, YYYY [at] H:mm A');
};
const Footer = ({ icon, footer, ts, parser, caret }) => {
    ts = parseTs(ts);
    return (React.createElement("div", { className: "footer" },
        !!icon && React.createElement("span", { className: "footer__icon", style: { backgroundImage: `url(${icon})` } }),
        React.createElement("div", { className: "footer__text", dangerouslySetInnerHTML: { __html: parser(footer) } }),
        !!ts && React.createElement("div", { className: "footer__ts" }, ts),
        " ",
        caret));
};
exports.default = Footer;
//# sourceMappingURL=Footer.js.map