import React from 'react';
import { isControlOrCommandPressed } from '../helpers/events';
import { useStyles } from './styles';
export var Link = function (_a) {
    var to = _a.to, children = _a.children, onClick = _a.onClick;
    var styles = useStyles();
    return (React.createElement("a", { href: to, onClick: function (e) {
            if ((!isControlOrCommandPressed(e) || !to) && onClick) {
                onClick();
                e.stopPropagation();
                e.preventDefault();
            }
        }, className: styles.link }, children));
};
