"use strict";
exports.__esModule = true;
exports.SocialButton = exports.cnSocialButton = void 0;
var tslib_1 = require("tslib");
// @ts-nocheck
require("./SocialButton.css");
var react_1 = (0, tslib_1.__importDefault)(require("react"));
var bem_1 = require("../../utils/bem");
var PropsWithAsAttributes_1 = require("../../utils/types/PropsWithAsAttributes");
var usePropsHandler_1 = require("../EventInterceptor/usePropsHandler");
exports.cnSocialButton = (0, bem_1.cn)('SocialButton');
exports.SocialButton = (0, PropsWithAsAttributes_1.forwardRefWithAs)(function (props) {
    var _a = (0, usePropsHandler_1.usePropsHandler)((0, exports.cnSocialButton)(), props), icon = _a.icon, _b = _a.as, as = _b === void 0 ? 'button' : _b, otherProps = (0, tslib_1.__rest)(_a, ["icon", "as"]);
    var Tag = as;
    var Icon = icon;
    var componentProps = {
        rel: Tag === 'a' ? 'noreferrer noopener' : undefined,
        target: Tag === 'a' ? '_blank' : undefined
    };
    return (react_1["default"].createElement(Tag, (0, tslib_1.__assign)({ className: (0, exports.cnSocialButton)() }, otherProps, componentProps),
        react_1["default"].createElement(Icon, { size: "xs" })));
});
