import type {
  LegacySessionActions,
  LegacySessionActionBaseProps,
} from "./legacySessionActionTypes";
import { useLegacyDraftActions } from "./useLegacyDraftActions";
import { useLegacyRunActions } from "./useLegacyRunActions";

interface UseLegacySessionActionsProps extends LegacySessionActionBaseProps {}

export function useLegacySessionActions({
  feedback,
  lifeRef,
  refreshMeta,
  setters,
  state,
}: UseLegacySessionActionsProps): LegacySessionActions {
  const draftActions = useLegacyDraftActions({
    feedback,
    lifeRef,
    refreshMeta,
    setters,
    state,
  });
  const runActions = useLegacyRunActions({
    feedback,
    lifeRef,
    refreshDraft: draftActions.refreshDraft,
    refreshMeta,
    setters,
    state,
  });

  return {
    ...draftActions,
    ...runActions,
  };
}
