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