import React from "react";
import { Typography } from "antd";
import classNames from "classnames";
import "./ReadPretty.less";
//#region src/components/dataSourceComponents/fields/Input.Url/ReadPretty.tsx
const { Link } = 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.createElement(Link, {
		className: classNames("pisell-url-read-pretty", { "pisell-url-read-pretty-table-view": renderMode === "tableView" }),
		href: formattedUrl,
		target: "_blank"
	}, value);
};
//#endregion
export { UrlReadPretty as default };
