import { useMemo } from 'react';
import { getContestStatus } from "../../../utils/election/index.js";
import useContestMetadata from '../useContestMetadata';
import useContestCandidatesMetadata from '../useContestCandidatesMetadata';
import useContestSummaryResults from '../useContestSummaryResults';
const useContestStatus = function useContestStatus(id) {
  const contestMetadata = useContestMetadata(id);
  const candidates = useContestCandidatesMetadata(id);
  const contestSummary = useContestSummaryResults(id);
  return useMemo(() => getContestStatus(contestMetadata, candidates, contestSummary), [id, contestMetadata, candidates, contestSummary]);
};
export default useContestStatus;