"use client";
import { jsx } from "react/jsx-runtime";
import * as React from "react";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { ComboboxInput } from "./ComboboxInput.js";
import { useAvailableEvents } from "./EventSelect.js";
function EventPatternInput({
  value,
  onChange,
  placeholder,
  disabled,
  categories,
  modules
}) {
  const t = useT();
  const resolvedPlaceholder = placeholder ?? t("ui.inputs.eventPatternInput.placeholder", "sales.orders.created");
  const { events } = useAvailableEvents({ categories, modules });
  const suggestions = React.useMemo(
    () => events.map((event) => ({
      value: event.id,
      label: event.label,
      description: event.id
    })),
    [events]
  );
  return /* @__PURE__ */ jsx(
    ComboboxInput,
    {
      value,
      onChange,
      placeholder: resolvedPlaceholder,
      suggestions,
      allowCustomValues: true,
      disabled
    }
  );
}
export {
  EventPatternInput
};
//# sourceMappingURL=EventPatternInput.js.map
