import { jsx as a, jsxs as h } from "react/jsx-runtime";
import { q as A, d as n } from "./index-C62tPk5p.js";
import { A as I } from "./AppCard-CQEg94Y3.js";
import { u as g } from "./useIsAppEnabled-DnQeiNdg.js";
const x = function({ app: t, eventType: i, onAppInstallSuccess: l }) {
  var r;
  const { getAppData: o, setAppData: s, disabled: d } = A(), p = o("MATOMO_URL"), c = o("SITE_ID"), { enabled: m, updateEnabled: u } = g(t);
  return /* @__PURE__ */ a(
    I,
    {
      onAppInstallSuccess: l,
      hideSettingsIcon: !0,
      app: t,
      switchOnClick: (e) => {
        u(e);
      },
      switchChecked: m,
      teamId: ((r = i.team) == null ? void 0 : r.id) || void 0,
      children: /* @__PURE__ */ h("div", { className: "flex flex-col gap-2", children: [
        /* @__PURE__ */ a(
          n,
          {
            dataTestid: `${t.slug}-url`,
            name: "Matomo URL",
            placeholder: "Enter your Matomo URL here",
            value: p,
            disabled: d,
            onChange: (e) => {
              s("MATOMO_URL", e.target.value);
            }
          }
        ),
        /* @__PURE__ */ a(
          n,
          {
            dataTestid: `${t.slug}-site-id`,
            disabled: d,
            name: "Site ID",
            placeholder: "Enter your Site ID",
            value: c,
            onChange: (e) => {
              s("SITE_ID", e.target.value);
            }
          }
        )
      ] })
    }
  );
};
export {
  x as default
};
