const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let classnames = require("classnames");
classnames = require_runtime.__toESM(classnames);
require("./ReadPretty.less");
//#region src/components/dataSourceComponents/fields/Input.Url/ReadPretty.tsx
const { Link } = antd.Typography;
const formatUrl = (url) => {
	if (!url) return "";
	if (url.startsWith("http://") || url.startsWith("https://")) return url;
	return `https://${url}`;
};
const UrlReadPretty = (props) => {
	const { value, renderMode } = props;
	const formattedUrl = formatUrl(value);
	return /* @__PURE__ */ react.default.createElement(Link, {
		className: (0, classnames.default)("pisell-url-read-pretty", { "pisell-url-read-pretty-table-view": renderMode === "tableView" }),
		href: formattedUrl,
		target: "_blank"
	}, value);
};
//#endregion
exports.default = UrlReadPretty;
