var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/components/pisellSingleLineText/components/ReadOnlyView.tsx
var ReadOnlyView_exports = {};
__export(ReadOnlyView_exports, {
  default: () => ReadOnlyView_default
});
module.exports = __toCommonJS(ReadOnlyView_exports);
var import_react = __toESM(require("react"));
var import_antd = require("antd");
var 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 defaultTextStyle = {
    fontSize: fontSize || 16,
    fontWeight: fontWeight || 500,
    // Medium
    color: color || "#101828",
    // Gray/900
    lineHeight: "24px",
    textAlign
  };
  const textStyle = {
    ...defaultTextStyle,
    ...style
  };
  const renderContent = () => {
    switch (displayVariant) {
      case "link":
        return /* @__PURE__ */ import_react.default.createElement(
          "span",
          {
            className: `pisell-single-line-text-link ${className || ""}`,
            onClick: onLinkClick,
            style: {
              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 ? void 0 : onLinkClick();
              }
            }
          },
          value || ""
        );
      case "badge":
        return /* @__PURE__ */ import_react.default.createElement(
          import_antd.Badge,
          {
            count: value || "",
            style: {
              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__ */ import_react.default.createElement(
          import_antd.Tag,
          {
            color: tagColor,
            closable: tagClosable,
            onClose: onTagClose,
            style: {
              backgroundColor: tagColor ? void 0 : "#F9FAFB",
              // Gray/50
              borderColor: tagColor ? void 0 : "#EAECF0",
              // Gray/200
              color: tagColor ? void 0 : "#344054",
              // Gray/700
              fontSize: "14px",
              fontWeight: 500,
              // Medium
              lineHeight: "20px",
              padding: "4px 12px",
              borderRadius: "16px",
              ...textStyle
            },
            className
          },
          value || ""
        );
      case "text":
      default:
        return /* @__PURE__ */ import_react.default.createElement(
          import_antd.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__ */ import_react.default.createElement(import_antd.Tooltip, { title: value }, content);
  }
  return content;
};
var ReadOnlyView_default = ReadOnlyView;
