import { __assign, __rest } from "tslib";
import { jsx as _jsx } from "react/jsx-runtime";
import cx from 'classnames';
import { forwardRef, useContext } from 'react';
import { DisabledContext } from '../disabled';
export var Link = forwardRef(function (props, ref) {
    var disabledContext = useContext(DisabledContext);
    var className = props.className, _a = props.disabled, disabled = _a === void 0 ? disabledContext.value : _a, _b = props.weak, weak = _b === void 0 ? false : _b, onClick = props.onClick, rest = __rest(props, ["className", "disabled", "weak", "onClick"]);
    return (_jsx("a", __assign({}, rest, { className: cx(className, 'zent-link', {
            'zent-link--disabled': disabled,
            'zent-link--weak': weak,
        }), ref: ref, onClick: disabled ? preventOpenLink : onClick, "data-zv": 'v10.0.12' }), void 0));
});
Link.displayName = 'Link';
function preventOpenLink(event) {
    event.preventDefault();
    event.stopPropagation();
}
