'use strict';

const jsxRuntime = require('react/jsx-runtime');
const React = require('react');
const addComponentPopover = require('./add-component-popover.cjs');
const button = require('../../../button.cjs');
const LucideIcons = require('lucide-react');
const utils = require('../../../../lib/utils.cjs');

function DividerControl({
  className,
  addPosition,
  parentLayerId
}) {
  const [popoverOpen, setPopoverOpen] = React.useState(false);
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: utils.cn("relative py-0", className), children: [
    /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute inset-0 flex items-center", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full border-t border-primary border-dashed" }) }),
    /* @__PURE__ */ jsxRuntime.jsx(
      addComponentPopover.AddComponentsPopover,
      {
        onOpenChange: setPopoverOpen,
        addPosition,
        parentLayerId,
        children: /* @__PURE__ */ jsxRuntime.jsxs(
          button.Button,
          {
            variant: "outline",
            className: "group flex items-center rounded-full bg-secondary h-min p-2 text-sm font-semibold text-secondar-foreground shadow-sm ring-1 ring-inset ring-secondary transition-all duration-200 ease-in-out gap-0",
            children: [
              /* @__PURE__ */ jsxRuntime.jsx(LucideIcons.PlusCircle, { className: "h-5 w-5 text-secondary-foreground" }),
              /* @__PURE__ */ jsxRuntime.jsx("span", { className: "sr-only", children: "Add component" }),
              /* @__PURE__ */ jsxRuntime.jsx("span", { className: utils.cn("overflow-hidden max-w-0 group-hover:max-w-xs transition-all duration-200 ease-in-out group-hover:pl-2", popoverOpen ? "max-w-xs pl-2" : "max-w-0"), children: "Add component" })
            ]
          }
        )
      }
    )
  ] });
}

exports.DividerControl = DividerControl;
