import { r as b, t as f, v as E, w as y, q as p, W as P } from "./index-jYYVpIDL.js";
import { useState as v } from "react";
import { A as w } from "./AppCard-pSUVQRE0.js";
import { u as x } from "./useIsAppEnabled-Tvqt7uu5.js";
import C from "./EventTypeAppSettingsInterface-E5GK1sGF.js";
const D = function({
  app: t,
  eventType: e,
  eventTypeFormMetadata: o
}) {
  var n;
  const { t: i } = b(), r = f.usePathname(), { getAppData: a, setAppData: c, disabled: m } = E(), { enabled: d, updateEnabled: l } = x(t), u = y(o), [h, S] = v(a("enabled")), s = !h && u;
  return /* @__PURE__ */ p.jsx(
    w,
    {
      returnTo: `${P}${r}?tabName=apps`,
      app: t,
      switchChecked: d,
      switchOnClick: (A) => {
        l(A);
      },
      teamId: ((n = e.team) == null ? void 0 : n.id) || void 0,
      disableSwitch: s,
      switchTooltip: s ? i("other_payment_app_enabled") : void 0,
      children: /* @__PURE__ */ p.jsx(
        C,
        {
          eventType: e,
          slug: t.slug,
          disabled: m,
          getAppData: a,
          setAppData: c
        }
      )
    }
  );
};
export {
  D as default
};
