"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.GlArrow = void 0;
var jsx_runtime_1 = require("react/jsx-runtime");
var downArrow_svg_1 = __importDefault(require("../assets/svg/downArrow.svg"));
var react_svg_1 = require("react-svg");
var react_1 = require("react");
var theme_1 = require("../theme");
exports.GlArrow = react_1.memo(function (props) {
    var _a;
    var className = props.className, link = props.link, direction = props.direction, hasCircularBorder = props.hasCircularBorder;
    var _b = useStyles({
        direction: direction,
        "hasCircularBorder": hasCircularBorder !== null && hasCircularBorder !== void 0 ? hasCircularBorder : false,
    }), classes = _b.classes, cx = _b.cx;
    return (jsx_runtime_1.jsx("div", __assign({ onClick: (_a = link === null || link === void 0 ? void 0 : link.onClick) !== null && _a !== void 0 ? _a : (function () { var _a; return (window.location.href = (_a = link === null || link === void 0 ? void 0 : link.href) !== null && _a !== void 0 ? _a : "#"); }), className: cx(classes.root, className) }, { children: jsx_runtime_1.jsx(react_svg_1.ReactSVG, { src: downArrow_svg_1.default }, void 0) }), void 0));
});
var useStyles = theme_1.makeStyles()(function (theme, _a) {
    var direction = _a.direction, hasCircularBorder = _a.hasCircularBorder;
    return ({
        "root": __assign(__assign({ "border": hasCircularBorder
                ? "solid " + (theme.isDarkModeEnabled
                    ? theme.colors.palette.light.main
                    : theme.colors.palette.dark.main) + " 2px"
                : undefined, "padding": 10, "borderRadius": "50%" }, (function () {
            var value = theme.spacing(5);
            return {
                "width": value,
                "height": value,
            };
        })()), { "transform": (function () {
                switch (direction) {
                    case "down":
                        return undefined;
                    case "up":
                        return "rotate(180deg)";
                    case "left":
                        return "rotate(90deg)";
                    case "right":
                        return "rotate(-90deg)";
                }
            })(), "alignItems": "center", "justifyContent": "center", "display": "flex", "& >div": {
                "display": "flex",
                "width": "12px",
                "& >svg": {
                    "fill": theme.isDarkModeEnabled
                        ? theme.colors.palette.light.main
                        : theme.colors.palette.dark.main,
                },
            } }),
    });
});
//# sourceMappingURL=GlArrow.js.map