pyb-ts
Version:
PYB-CLI - Minimal AI Agent with multi-model support and CLI interface
19 lines (18 loc) • 708 B
JavaScript
import InkLink from "ink-link";
import { Text } from "ink";
import React from "react";
import { env } from "@utils/env";
const LINK_SUPPORTING_TERMINALS = ["iTerm.app", "WezTerm", "Hyper", "VSCode"];
function Link({ url, children }) {
const supportsLinks = LINK_SUPPORTING_TERMINALS.includes(env.terminal ?? "");
const displayContent = children || url;
if (supportsLinks || displayContent !== url) {
return /* @__PURE__ */ React.createElement(InkLink, { url }, /* @__PURE__ */ React.createElement(Text, null, displayContent));
} else {
return /* @__PURE__ */ React.createElement(Text, { underline: true }, displayContent);
}
}
export {
Link as default
};
//# sourceMappingURL=Link.js.map