import e from"classnames";import{Link as t}from"react-router-dom";import r from"prop-types";import{noop as n}from"lodash";import{useDevCenterRouter as o}from"../effects/useDevCenterRouter.js";import a from"./UniversalLink.css.js";import{jsx as i}from"react/jsx-runtime";function s(r){var n=r.href,s=r.children,l=r.className,c=r["data-testid"],m=r.onClick,d=o();return d?i("a",{href:n||null,children:i("button",{"data-testid":c,tabIndex:"0",role:"link",className:e(a.buttonLink,l),onClick:function(e){n&&(e.stopPropagation(),m(e),e.metaKey||e.ctrlKey?window.open(n,"_blank"):d.push(n))},children:s})}):i(t,{"data-testid":c,to:n,className:l,children:s})}s.propTypes={href:r.any,children:r.node.isRequired,className:r.string,onClick:r.func,"data-testid":r.string},s.defaultProps={className:null,"data-testid":"UniversalLink",href:null,onClick:n};export{s as UniversalLink};
//# sourceMappingURL=UniversalLink.js.map
