"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.GlFooterInfo = void 0;
var jsx_runtime_1 = require("react/jsx-runtime");
var react_1 = require("react");
var validateEmail_1 = require("../tools/validateEmail");
var validatePhoneNumber_1 = require("../tools/validatePhoneNumber");
var Link_1 = __importDefault(require("@material-ui/core/Link"));
var theme_1 = require("../theme");
var useStyles = theme_1.makeStyles()(function (theme) { return ({
    "root": __assign({ "display": "flex", "flexDirection": "column", "alignItems": "center", "justifyContent": "center", "gap": theme.spacing(1) }, (function () {
        var value = theme.spacing(4);
        return {
            "paddingTop": value,
            "paddingBottom": value,
        };
    })()),
    "email": {
        "color": theme.colors.useCases.typography.textSecondary,
    },
}); });
exports.GlFooterInfo = react_1.memo(function (props) {
    var email = props.email, phoneNumber = props.phoneNumber, className = props.className;
    if (email !== undefined && !validateEmail_1.validateEmail(email)) {
        throw new Error("email entered as prop is not valid!");
    }
    if (phoneNumber !== undefined && !validatePhoneNumber_1.validatePhoneNumber(phoneNumber)) {
        throw new Error("phone number not valid!");
    }
    var _a = useStyles(), classes = _a.classes, cx = _a.cx;
    return (jsx_runtime_1.jsxs("div", __assign({ className: cx(classes.root, className) }, { children: [email !== undefined && (jsx_runtime_1.jsx(Link_1.default, __assign({ className: classes.email, href: "mailto:" + email }, { children: email }), void 0)),
            phoneNumber !== undefined && (jsx_runtime_1.jsx(theme_1.Text, __assign({ typo: "body 2" }, { children: phoneNumber }), void 0))] }), void 0));
});
//# sourceMappingURL=GlFooterInfo.js.map