import { j as jsxRuntimeExports } from "../../../../../_virtual/jsx-runtime.js";
import { a as v } from "../../../../sdk/dist/shared/chunk-IKC3FK7L.js";
import "../../../../sdk/dist/shared/chunk-3YVJ2ELD.js";
import "../../../../sdk/dist/shared/chunk-AFVJZPLS.js";
import "@sinclair/typebox";
import "../../../../sdk/dist/shared/chunk-A3GF4PYW.js";
import "../../../../sdk/dist/shared/chunk-W33JMRRN.js";
import { tx as D } from "../../../../style-system/dist/twind.js";
import { useBrickStyle } from "../hooks/use-brick-style.js";
import { InlineIcon } from "../../../../../node_modules/.pnpm/@iconify_react@6.0.0_react@19.1.1/node_modules/@iconify/react/dist/iconify.js";
import BrickRoot from "../components/BrickRoot.js";
function SocialLinks({ brick, editable }) {
  const styles = useBrickStyle(brick);
  const { props } = brick;
  const links = Array.isArray(props.links) ? props.links : [];
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
    BrickRoot,
    {
      brick,
      editable,
      manifest: v,
      className: D("flex justify-start items-start gap-2", Object.values(styles)),
      children: [
        editable && links.length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-center p-4 border-2 border-dashed border-gray-300 dark:border-gray-600 rounded-md", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-gray-500 dark:text-gray-400", children: "Add social links to get started" }) }),
        links.map((link, index) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "a",
            {
              href: link.href,
              "data-prevented-by-editor": editable ? "true" : "false",
              onClick: (e) => {
                if (editable) {
                  e.preventDefault();
                }
              },
              className: D("grow flex items-center gap-0.5 hover:opacity-80"),
              title: link.label || link.href,
              children: [
                link.icon && /* @__PURE__ */ jsxRuntimeExports.jsx(InlineIcon, { icon: link.icon, className: "text-[100%]" }),
                !props.iconOnly && link.label && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "ml-1 text-nowrap", children: link.label })
              ]
            },
            index
          );
        })
      ]
    }
  );
}
export {
  SocialLinks as default
};
//# sourceMappingURL=social-links.js.map
