import { jsxs as l, jsx as r } from "react/jsx-runtime";
import { forwardRef as h } from "react";
import { c as y } from "./index.Bxix3KXR.js";
import { _ as n } from "./twind.BLUk_ZzT.js";
import { b as x } from "./use-section-style.Cg6VYj5D.js";
import { a as u } from "./iconify.Bxbp05s7.js";
const b = h(({ brick: a, editable: s }, c) => {
  var o;
  const d = x(a), { props: t } = a, i = Array.isArray(t.links) ? t.links : [], m = ((o = t.display) == null ? void 0 : o.includes("row")) ?? !1;
  return /* @__PURE__ */ l(
    "div",
    {
      ref: c,
      className: n(
        "flex flex-grow shrink-0 justify-start items-start min-h-fit min-w-fit gap-2",
        m ? "flex-row" : "flex-col items-stretch",
        Object.values(d)
      ),
      children: [
        s && i.length === 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-4 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: /* @__PURE__ */ r("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Add social links to get started" }) }),
        i.map((e, f) => /* @__PURE__ */ l(
          "a",
          {
            href: e.href,
            "data-prevented-by-editor": s ? "true" : "false",
            onClick: (p) => {
              s && (y(
                `This link is not clickable in edit mode but will lead to ${e.href} when published.`,
                {
                  id: "social-link-no-click-toast",
                  style: {
                    minWidth: "max-content"
                  }
                }
              ), p.preventDefault());
            },
            className: n("grow flex items-center gap-0.5 hover:opacity-80"),
            title: e.label || e.href,
            children: [
              e.icon && /* @__PURE__ */ r(u, { icon: e.icon, className: "text-[100%]" }),
              !t.icononly && e.label && /* @__PURE__ */ r("span", { className: "ml-1 text-nowrap", children: e.label })
            ]
          },
          f
        ))
      ]
    }
  );
});
b.displayName = "SocialLinks";
export {
  b as default
};
//# sourceMappingURL=social-links.-apACLht.js.map
