import { jsxs as i, jsx as n, Fragment as W } from "react/jsx-runtime";
import { GeneratedWithAIPill as k } from "./index-GeneratedWithAIPill.js";
import { InfoIcon as y } from "./index-InfoIcon.js";
import { classNames as l } from "./index-classNames.js";
import { Button as z, ButtonTypes as F, ButtonSizes as T } from "./index-Button.js";
import { ComponentContainer as E } from "./index-ComponentContainer.js";
import { IconSize as m } from "./index-Icon.js";
import { IconNames as M } from "./index-IconNames.js";
import { Popover as S } from "./index-Popover.js";
import { FontWeights as j, Text as w, TextTypes as O } from "./index-Text.js";
import "react";
import t from "./index-EditableCard.module.scss.js";
const X = (c) => {
  const {
    className: p,
    title: f,
    titleWeight: u = j.medium,
    titleAiInfo: e,
    editCallback: o,
    editButtonFloatRight: h = !1,
    hideEditButton: r,
    popoverMessage: s,
    children: g,
    testId: v,
    translate: x = !0,
    hoverable: B = !1,
    padding: C = !1,
    actionBtns: N,
    shouldHaveOnClickEventOnContainer: a = !0
  } = c;
  function b(d, I = !1) {
    return I ? null : s ? n(S, {
      message: s,
      children: d
    }) : d;
  }
  return i(E, {
    testId: v,
    className: l(t.container, B ? t.hoverable : void 0, C ? t.padding : void 0, a && o && !r ? t.editable : void 0, p),
    onClick: a && o && !r ? o : void 0,
    children: [i("div", {
      className: l(t.header, h ? t.editButtonFloatRight : void 0),
      children: [i("div", {
        children: [n(w, {
          testId: "title",
          type: O.textIntro,
          fontWeight: u,
          translate: x,
          children: f
        }), (e == null ? void 0 : e.show) && i(W, {
          children: [(e == null ? void 0 : e.tooltipMessage) && n(y, {
            message: e == null ? void 0 : e.tooltipMessage,
            theme: "dark",
            size: m.small,
            maxWidth: "fit-content"
          }), n(k, {
            text: e.text,
            testId: "editable-card-generated-with-ai-pill"
          })]
        })]
      }), i("div", {
        className: t.actionBtns,
        children: [N, b(n(z, {
          testId: "cta",
          size: T.small,
          iconLeft: M.edit,
          iconSize: m.small,
          iconColor: "--n500",
          onClick: a ? void 0 : o,
          type: F.default
        }), r)]
      })]
    }), n("div", {
      className: t.content,
      children: g
    })]
  });
};
export {
  X as EditableCard
};
