import { _objectSpread2 } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
import React from "react";
import { Badge, Tag, Tooltip, Typography } from "antd";
//#region src/components/pisellSingleLineText/components/ReadOnlyView.tsx
/**
* PisellSingleLineText 只读态视图组件
* 
* 负责渲染只读态的文本展示，支持多种展示样式变体（基于 Figma 设计规范）
* 
* 功能：
* - 普通文本展示（默认）- 16px, Medium, Gray/900
* - 超链接样式 - 链接色，带下划线
* - 徽标样式 - 圆形红色徽标（类似通知数量）
* - 标签样式 - 灰色边框标签
* - 文本截断（ellipsis）
* - Tooltip 悬停提示完整内容
* - 自定义样式（字号、字重、颜色、对齐）
* 
* @param props 组件 Props
*/
const ReadOnlyView = (props) => {
	const { value, displayVariant = "text", onLinkClick, badgeStatus = "default", tagColor, tagClosable = false, onTagClose, ellipsis = true, showTooltip = true, fontSize, fontWeight, color, textAlign = "left", className, style } = props;
	const textStyle = _objectSpread2(_objectSpread2({}, {
		fontSize: fontSize || 16,
		fontWeight: fontWeight || 500,
		color: color || "#101828",
		lineHeight: "24px",
		textAlign
	}), style);
	/**
	* 渲染不同样式变体的内容
	*/
	const renderContent = () => {
		switch (displayVariant) {
			case "link": return /* @__PURE__ */ React.createElement("span", {
				className: `pisell-single-line-text-link ${className || ""}`,
				onClick: onLinkClick,
				style: _objectSpread2({
					fontSize: fontSize || 16,
					fontWeight: fontWeight || 500,
					color: color || "#7F56DA",
					textDecoration: "underline",
					textDecorationStyle: "double",
					cursor: "pointer",
					display: "inline-block",
					lineHeight: "24px"
				}, style),
				role: "link",
				tabIndex: 0,
				onKeyDown: (e) => {
					if (e.key === "Enter" || e.key === " ") onLinkClick === null || onLinkClick === void 0 || onLinkClick();
				}
			}, value || "");
			case "badge": return /* @__PURE__ */ React.createElement(Badge, {
				count: value || "",
				style: _objectSpread2({
					backgroundColor: badgeStatus === "error" ? "#D92D20" : void 0,
					color: "#FFFFFF",
					fontSize: "14px",
					fontWeight: 400,
					lineHeight: "20px",
					borderRadius: "16px",
					padding: "0 4px",
					minWidth: "20px",
					height: "20px",
					border: "1px solid white"
				}, style),
				className
			});
			case "tag": return /* @__PURE__ */ React.createElement(Tag, {
				color: tagColor,
				closable: tagClosable,
				onClose: onTagClose,
				style: _objectSpread2({
					backgroundColor: tagColor ? void 0 : "#F9FAFB",
					borderColor: tagColor ? void 0 : "#EAECF0",
					color: tagColor ? void 0 : "#344054",
					fontSize: "14px",
					fontWeight: 500,
					lineHeight: "20px",
					padding: "4px 12px",
					borderRadius: "16px"
				}, textStyle),
				className
			}, value || "");
			default: return /* @__PURE__ */ React.createElement(Typography.Text, {
				ellipsis,
				style: textStyle,
				className: `pisell-single-line-text-read ${className || ""}`
			}, value || "");
		}
	};
	const content = renderContent();
	if (showTooltip && ellipsis && value && (displayVariant === "text" || displayVariant === "link")) return /* @__PURE__ */ React.createElement(Tooltip, { title: value }, content);
	return content;
};
//#endregion
export { ReadOnlyView as default };
