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 __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
import { jsx as _jsx } from "react/jsx-runtime";
import { memo } from "react";
import { useIsDarkModeEnabled } from "onyxia-ui/lib";
import { makeStyles } from "../theme";
import GithubBtn from "react-github-btn";
export var GlGithubStarCount = memo(function (props) {
    var repoUrl = props.repoUrl, size = props.size, className = props.className, showCount = props.showCount;
    var _a = useStyles(), classes = _a.classes, cx = _a.cx;
    var themeVariant = (function useClosure() {
        var isDarkModeEnabled = useIsDarkModeEnabled().isDarkModeEnabled;
        var themeVariant = isDarkModeEnabled ? "dark" : "light";
        return { themeVariant: themeVariant };
    })().themeVariant;
    return (_jsx("div", __assign({ className: cx(classes.root, className) }, { children: _jsx(GithubBtn, { href: repoUrl, "data-color-scheme": __spreadArray([
                "no-preference: light;"
            ], __read(["light", "dark"].map(function (osPref) { return "".concat(osPref, ": ").concat(themeVariant, ";"); })), false).join("\n"), "data-icon": "octicon-star", "data-size": size === "large" ? size : "", "data-show-count": "".concat(showCount !== null && showCount !== void 0 ? showCount : false) }) })));
});
var useStyles = makeStyles({ "name": { GlGithubStarCount: GlGithubStarCount } })({
    "root": {
        "& span": {
            "display": "flex",
            "alignItems": "center",
        },
    },
});
//# sourceMappingURL=GlGithubStarCount.js.map