synapse-react-client
Version:
[](https://badge.fury.io/js/synapse-react-client) [](https://github.com/prettier/prettie
19 lines (18 loc) • 475 B
JavaScript
import { useInRouterContext as r, Link as i } from "react-router";
import { isExternalLink as a } from "../../utils/functions/IsExternalLink.js";
function u(n, t) {
const e = r(), o = n ? a(n) : !1;
return n && e && !o ? {
component: i,
to: n
} : {
component: n ? "a" : void 0,
href: n,
target: t ?? (o ? "_blank" : void 0),
rel: o ? "noopener noreferrer" : void 0
};
}
export {
u as useSmartLink
};
//# sourceMappingURL=useSmartLink.js.map