"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Flag } from "lucide-react";
import {
  Select,
  SelectContent,
  SelectItem,
  SelectTrigger,
  SelectTriggerLeading,
  SelectValue
} from "@open-mercato/ui/primitives/select";
function PipelineSelect({
  id,
  pipelines,
  value,
  onChange,
  disabled = false,
  placeholder
}) {
  return /* @__PURE__ */ jsxs(
    Select,
    {
      value: typeof value === "string" && value ? value : void 0,
      onValueChange: (next) => onChange(next ?? ""),
      disabled,
      children: [
        /* @__PURE__ */ jsxs(SelectTrigger, { id, size: "default", children: [
          /* @__PURE__ */ jsx(SelectTriggerLeading, { children: /* @__PURE__ */ jsx(Flag, { className: "size-4 text-muted-foreground", "aria-hidden": "true" }) }),
          /* @__PURE__ */ jsx(SelectValue, { placeholder })
        ] }),
        /* @__PURE__ */ jsx(SelectContent, { children: pipelines.map((pipeline) => /* @__PURE__ */ jsx(SelectItem, { value: pipeline.id, children: pipeline.name }, pipeline.id)) })
      ]
    }
  );
}
var PipelineSelect_default = PipelineSelect;
export {
  PipelineSelect,
  PipelineSelect_default as default
};
//# sourceMappingURL=PipelineSelect.js.map
