import { jsx as _jsx } from "react/jsx-runtime";
import css from '../DoctorProfile.module.scss';
import { _cx } from 'src/utility/class';
var cx = _cx(css);
export var SocialIconsContainer = function (_a) {
    var SocialIconProps = _a.SocialIconProps, callback = _a.callback, style = _a.style;
    return (_jsx("div", { className: cx('social-icons'), style: style, children: Object.keys(SocialIconProps).map(function (icon, i) {
            var _a, _b, _c, _d, _e, _f, _g;
            return ((_a = SocialIconProps[icon]) === null || _a === void 0 ? void 0 : _a.image) &&
                ((_b = SocialIconProps[icon]) === null || _b === void 0 ? void 0 : _b.label) &&
                ((_c = SocialIconProps[icon]) === null || _c === void 0 ? void 0 : _c.url) && (_jsx("a", { style: { width: '30px', height: '30px' }, href: (_d = SocialIconProps[icon]) === null || _d === void 0 ? void 0 : _d.url, target: "_blank", children: _jsx("img", { className: cx('social-icons'), width: "30px", height: "30px", src: (_e = SocialIconProps[icon]) === null || _e === void 0 ? void 0 : _e.image, alt: (_f = SocialIconProps[icon]) === null || _f === void 0 ? void 0 : _f.label, onClick: function () { return callback(SocialIconProps[icon]); } }) }, "".concat((_g = SocialIconProps[icon]) === null || _g === void 0 ? void 0 : _g.label, "-").concat(i)));
        }) }));
};
export var getSocialIconProps = function (bio, socialIcons) {
    var _a = bio || {}, instagram_url = _a.instagram_url, whatsapp_number = _a.whatsapp_number, facebook_url = _a.facebook_url, twitter_url = _a.twitter_url, youtube_url = _a.youtube_url;
    var _b = socialIcons || {}, instagramLabel = _b.instagramLabel, whatsappLabel = _b.whatsappLabel, facebookLabel = _b.facebookLabel, twitterLabel = _b.twitterLabel, youtubeLabel = _b.youtubeLabel;
    var getWhatsAppUrl = function (whatsapp) {
        if (!whatsapp)
            return undefined;
        if (whatsapp.startsWith('http://') || whatsapp.startsWith('https://')) {
            return whatsapp;
        }
        return "https://wa.me/".concat(whatsapp); // alternatively, use the whatsapp web link: https://web.whatsapp.com/send?phone=${whatsapp}
    };
    return {
        instagram: {
            label: instagramLabel,
            url: instagram_url,
            image: 'https://images.ctfassets.net/vh25xg5i1h5l/3YuX2LAQtSEnbscFJ3xWoG/35e02a7381259bd0b789f4a9254992d6/instagram.png',
        },
        whatsapp: {
            label: whatsappLabel,
            url: getWhatsAppUrl(whatsapp_number),
            image: 'https://images.ctfassets.net/vh25xg5i1h5l/7xgNZVLYOnMmW3DV6fRBUN/b048166285578e69a95b939c264c3c60/wpp_image__1_.png',
        },
        facebook: {
            label: facebookLabel,
            url: facebook_url,
            image: 'https://images.ctfassets.net/vh25xg5i1h5l/33Zl9hlDrS88JIeROVFgjb/a3506da23c9cb4de80560379f58470de/Invisalign_icon_facebook_blue__1_.svg',
        },
        twitter: {
            label: twitterLabel,
            url: twitter_url,
            image: 'https://images.ctfassets.net/vh25xg5i1h5l/5p23ccB4bKg6tvDeIe7BED/776e8dca19e4acd65c76adaabbee080b/Invisalign_icon_twitter_blue.svg',
        },
        youtube: {
            label: youtubeLabel,
            url: youtube_url,
            image: 'https://images.ctfassets.net/vh25xg5i1h5l/25yAuU9Ep07cwUdCBzEiaG/322bba904be4761653271bab8a8ea9fe/Invisalign_icon_youtube_blue.svg',
        },
    };
};
