import { __assign, __rest } from "tslib";
import React, { useContext } from 'react';
import classNames from 'classnames';
import { ConfigContext } from '../config-provider/config-context';
import { getPrefixCls } from '../_utils/general';
var Link = function (props) {
    var _a;
    var _b = props.disabled, disabled = _b === void 0 ? false : _b, _c = props.external, external = _c === void 0 ? true : _c, _d = props.underline, underline = _d === void 0 ? true : _d, className = props.className, style = props.style, children = props.children, target = props.target, customisedCls = props.prefixCls, otherProps = __rest(props, ["disabled", "external", "underline", "className", "style", "children", "target", "prefixCls"]);
    var configContext = useContext(ConfigContext);
    var prefixCls = getPrefixCls('link', configContext.prefixCls, customisedCls);
    var cls = classNames(prefixCls, className, (_a = {},
        _a[prefixCls + "_disabled"] = disabled,
        _a[prefixCls + "_no-underline"] = !underline,
        _a));
    if (disabled) {
        delete otherProps.href;
    }
    return (React.createElement("a", __assign({}, otherProps, { target: target ? target : external ? '_blank' : '_self', className: cls, style: style, role: "link", "aria-disabled": disabled }),
        React.createElement("span", null, children)));
};
Link.displayName = 'Link';
export default Link;
//# sourceMappingURL=index.js.map