"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const require$$0 = require("react/jsx-runtime");
const iconsReact = require("@choiceform/icons-react");
const React = require("react");
const designSystem = require("@choiceform/design-system");
const codeBlockFooterTv = designSystem.tcv({
  slots: {
    footer: "flex h-6 items-center justify-center px-2",
    icon: ""
  },
  variants: {
    codeExpanded: {
      true: {
        footer: "bg-transparent-background hover:bg-secondary-background",
        icon: "opacity-0 group-hover:opacity-100"
      },
      false: {
        footer: [
          "bg-secondary-background/90 absolute inset-x-0 bottom-0 z-3",
          "opacity-0 group-hover:opacity-100",
          "hover:bg-secondary-background"
        ]
      }
    }
  },
  defaultVariants: {
    codeExpanded: false
  }
});
const Footer = React.memo(function Footer2(props) {
  const { className, codeBlock } = props;
  if (!codeBlock) return null;
  const { isExpanded, codeExpanded, handleCodeExpand, lineCount, lineThreshold, needsScroll } = codeBlock;
  const tv = codeBlockFooterTv({ codeExpanded });
  if (!(lineCount > lineThreshold || needsScroll || codeExpanded) || !isExpanded) {
    return null;
  }
  return /* @__PURE__ */ require$$0.jsx(
    "div",
    {
      className: tv.footer({ className }),
      onClick: handleCodeExpand,
      children: /* @__PURE__ */ require$$0.jsx("div", { className: tv.icon(), children: codeExpanded ? /* @__PURE__ */ require$$0.jsx(iconsReact.ChevronUpSmall, {}) : /* @__PURE__ */ require$$0.jsx(iconsReact.ChevronDownSmall, {}) })
    }
  );
});
exports.Footer = Footer;
//# sourceMappingURL=footer.cjs.map
