import type {
  LegacySessionAutoplayProps,
  LegacySessionBootstrapProps,
  LegacySessionDraftPromotionProps,
} from "./legacySessionActionTypes";
import { useLegacySessionAutoplay } from "./useLegacySessionAutoplay";
import { useLegacySessionBootstrap } from "./useLegacySessionBootstrap";
import { useLegacySessionDraftPromotion } from "./useLegacySessionDraftPromotion";

interface LegacySessionLifecycleProps
  extends
    LegacySessionBootstrapProps,
    LegacySessionAutoplayProps,
    LegacySessionDraftPromotionProps {}

export function useLegacySessionLifecycle({
  addActivity,
  autoPlaySpeed,
  clearError,
  lifeRef,
  refreshDraft,
  refreshMeta,
  selectedTalentIds,
  setAllocation,
  setAutoPlaySpeed,
  setIsBusy,
  setIsReady,
  setSpecialThanks,
  setStage,
  showError,
  stage,
  stepLife,
  trajectoryIsEnd,
}: LegacySessionLifecycleProps) {
  useLegacySessionBootstrap({
    addActivity,
    clearError,
    lifeRef,
    refreshDraft,
    refreshMeta,
    setIsBusy,
    setIsReady,
    setSpecialThanks,
    showError,
  });
  useLegacySessionAutoplay({
    autoPlaySpeed,
    setAutoPlaySpeed,
    stage,
    stepLife,
    trajectoryIsEnd,
  });
  useLegacySessionDraftPromotion({
    addActivity,
    lifeRef,
    selectedTalentIds,
    setAllocation,
    setStage,
    stage,
  });
}
