import{__rest as e,__assign as t}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as o,jsxs as i}from"react/jsx-runtime";import{forwardRef as l}from"react";import a from"classnames";import r from"@material-ui/icons/Language";import{Tooltip as s}from"../Tooltip/Tooltip.js";import n from"./TextLink.scss.js";var c=l((function(i,l){var a=i.to,r=i.children,s=e(i,["to","children"]);return o("a",t({},s,{href:a,ref:l,children:r}))})),d=l((function(l,d){var m=l.children,p=l.className,f=l.testId,b=l.disableTooltip,h=l.disabled,u=l.component,v=void 0===u?c:u,N=l.to,g=l.onClick,k=l.target,T=void 0===k?"_blank":k,j=e(l,["children","className","testId","disableTooltip","disabled","component","to","onClick","target"]),x=a(n.root,h?n.disabled:n.enabled),C=null==N?void 0:N.replaceAll("/","/​");return o(s,{title:i("div",{className:n.tooltip,children:[o(r,{fontSize:"small",className:n.icon}),C]}),disabled:b,placement:"bottom-start",children:o("span",{ref:d,className:p,children:h?o("span",{className:x,children:m}):o(v,t({onClick:g,className:x,"data-testid":f,to:N,target:T},j,{children:m}))})})}));export{d as TextLink};
