import { jsx as a } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js";
/* empty css               */
import { useState as k, useCallback as e } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/hooks/dist/hooks.module.js";
import { CapitalOffer as C } from "../../../CapitalOffer/components/CapitalOffer/CapitalOffer.js";
import { GrantsDisplay as b } from "./GrantsDisplay.js";
import { Fragment as x } from "../../../../../external/.pnpm/preact@10.28.2/node_modules/preact/dist/preact.module.js";
const V = ({
  externalDynamicOffersConfig: l,
  grantList: p,
  newOfferAvailable: m,
  onFundsRequest: t,
  onGrantListUpdateRequest: i,
  onOfferDismiss: s
}) => {
  const [c, o] = k(!1), r = e(() => o(!1), []), n = e(() => o(!0), []), u = e(() => {
    s ? s(r) : r();
  }, [r, s]), g = e(
    (f) => {
      t ? t(f) : (i(f), o(!1));
    },
    [t, i]
  );
  return /* @__PURE__ */ a(x, { children: c ? /* @__PURE__ */ a(
    C,
    {
      externalDynamicOffersConfig: l,
      onFundsRequest: g,
      onOfferDismiss: u
    }
  ) : /* @__PURE__ */ a(b, { grantList: p, newOfferAvailable: m, onNewOfferRequest: n }) });
};
export {
  V as GrantList
};
