"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Users } from "lucide-react";
import { DealSectionCard } from "./DealSectionCard.js";
import { DealFormField } from "./DealFormField.js";
import { DealAssociationsField } from "./DealAssociationsField.js";
function DealAssociationsSection({
  tr,
  personIds,
  companyIds,
  onPeopleChange,
  onCompaniesChange,
  disabled
}) {
  const peopleLabels = {
    placeholder: tr("customers.deals.create.associations.peoplePlaceholder", "Search people by name or email\u2026"),
    empty: tr("customers.deals.form.people.empty", "No people linked yet."),
    loading: tr("customers.deals.form.people.loading", "Searching people\u2026"),
    noResults: tr("customers.deals.form.people.noResults", "No people match your search."),
    remove: tr("customers.deals.form.assignees.remove", "Remove"),
    error: tr("customers.deals.form.people.error", "Failed to load people.")
  };
  const companyLabels = {
    placeholder: tr("customers.deals.create.associations.companiesPlaceholder", "Search companies by name or domain\u2026"),
    empty: tr("customers.deals.form.companies.empty", "No companies linked yet."),
    loading: tr("customers.deals.form.companies.loading", "Searching companies\u2026"),
    noResults: tr("customers.deals.form.companies.noResults", "No companies match your search."),
    remove: tr("customers.deals.form.assignees.remove", "Remove"),
    error: tr("customers.deals.form.companies.error", "Failed to load companies.")
  };
  return /* @__PURE__ */ jsxs(
    DealSectionCard,
    {
      icon: Users,
      title: tr("customers.deals.create.sections.associations.title", "Associations"),
      subtitle: tr("customers.deals.create.sections.associations.subtitle", "Link people and companies to this deal"),
      children: [
        /* @__PURE__ */ jsx(DealFormField, { fieldId: "personIds", label: tr("customers.people.detail.deals.fields.people", "People"), children: /* @__PURE__ */ jsx(
          DealAssociationsField,
          {
            kind: "people",
            value: personIds,
            onChange: onPeopleChange,
            disabled,
            labels: peopleLabels
          }
        ) }),
        /* @__PURE__ */ jsx(DealFormField, { fieldId: "companyIds", label: tr("customers.people.detail.deals.fields.companies", "Companies"), children: /* @__PURE__ */ jsx(
          DealAssociationsField,
          {
            kind: "companies",
            value: companyIds,
            onChange: onCompaniesChange,
            disabled,
            labels: companyLabels
          }
        ) })
      ]
    }
  );
}
var DealAssociationsSection_default = DealAssociationsSection;
export {
  DealAssociationsSection,
  DealAssociationsSection_default as default
};
//# sourceMappingURL=DealAssociationsSection.js.map
