@onwave/ui
Version:
onwave ui library
12 lines • 556 B
JavaScript
import NextLink from "next/link";
import React from "react";
import { useLinkContext } from "../../contexts/LinkContext";
export var DynamicLink = function (_a) {
var href = _a.href, outLink = _a.outLink, children = _a.children;
var type = useLinkContext().type;
if (!outLink && type === "Next" && href) {
return React.createElement(NextLink, { href: href }, children);
}
return React.createElement("a", { href: href === null || href === void 0 ? void 0 : href.toString() }, children);
};
//# sourceMappingURL=DynamicLink.js.map