"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Link = void 0;
var react_1 = __importDefault(require("react"));
var events_1 = require("../helpers/events");
var styles_1 = require("./styles");
var Link = function (_a) {
    var to = _a.to, children = _a.children, onClick = _a.onClick;
    var styles = (0, styles_1.useStyles)();
    return (react_1.default.createElement("a", { href: to, onClick: function (e) {
            if ((!(0, events_1.isControlOrCommandPressed)(e) || !to) && onClick) {
                onClick();
                e.stopPropagation();
                e.preventDefault();
            }
        }, className: styles.link }, children));
};
exports.Link = Link;
