import { jsx as p } from "react/jsx-runtime";
import { o as f, p as E, q as y, r as P, W as C } from "./index-C62tPk5p.js";
import { useState as g } from "react";
import { A as v } from "./AppCard-CQEg94Y3.js";
import { u as w } from "./useIsAppEnabled-DnQeiNdg.js";
import S from "./EventTypeAppSettingsInterface-DrevXJNI.js";
const L = function({
  app: t,
  eventType: e,
  eventTypeFormMetadata: n,
  onAppInstallSuccess: r
}) {
  var o;
  const { t: i } = f(), m = E.usePathname(), { getAppData: a, setAppData: c, disabled: d } = y(), { enabled: l, updateEnabled: u } = w(t), h = P(n), [A, T] = g(a("enabled")), s = !A && h;
  return /* @__PURE__ */ p(
    v,
    {
      onAppInstallSuccess: r,
      returnTo: `${C}${m}?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: c
        }
      )
    }
  );
};
export {
  L as default
};
