@playlive/react-query
    Preparing search index...

    Function useDonationTrainState

    • Stateful donation-train view — mirrors the overlay's useDonationTrains.ts byte-for-byte so the overlay can eventually collapse to a re-export of this hook.

      Composition:

      • useDonationTrains (query) drives the baseline train list.
      • useDonationTrainHighRateDonors + useDonationTrainCommonTrains expose the two stats surfaces.
      • useEffect on donations POSTs to process-donations/ and folds the response into local state (updated in place, new ACTIVE/PENDING/ENDING trains prepended).
      • updateTrainStatus / updateTrainVisibility fire one-shot fetches and swap the matching train in local state on success.

      Parameters

      Returns UseDonationTrainStateResult

      UseDonationTrainStateResult.

      const { trains, updateTrainVisibility } = useDonationTrainState({
      campaignID,
      donations,
      isDashboard: false,
      });