"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useT } from "@open-mercato/shared/lib/i18n/context";
function OrgSwitcher({ options, selectedId, onChange }) {
  const t = useT();
  if (options.length <= 1) return null;
  return /* @__PURE__ */ jsxs("label", { className: "flex items-center gap-2 text-sm text-muted-foreground", children: [
    /* @__PURE__ */ jsx("span", { children: t("customer_accounts.domainMapping.orgSwitcher.label", "Organization") }),
    /* @__PURE__ */ jsx(
      "select",
      {
        className: "h-9 rounded-md border border-input bg-background px-3 text-sm text-foreground shadow-xs focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
        value: selectedId ?? "",
        onChange: (event) => onChange(event.target.value),
        children: options.map((opt) => {
          const indent = opt.depth > 0 ? "\xA0\xA0".repeat(opt.depth) : "";
          return /* @__PURE__ */ jsxs("option", { value: opt.id, children: [
            indent,
            opt.label
          ] }, opt.id);
        })
      }
    )
  ] });
}
var OrgSwitcher_default = OrgSwitcher;
export {
  OrgSwitcher,
  OrgSwitcher_default as default
};
//# sourceMappingURL=OrgSwitcher.js.map
