import { atomFamily } from 'recoil';

/**
 * Atom family for storing the metadata for an individual contest. The family
 * key is the contest ID.
 *
 * ```
 * {
 *   id: ContestId;
 *   date: string;
 *   stateFips: string;
 *   office: string;
 *   districtNumber: string;
 *   senateClass: string;
 *   city: string;
 *   contestType: string;
 *   rating: string;
 *   holdingParty: string;
 *   isSpecial: boolean;
 *   isBallot: boolean;
 *   isUncontested: boolean;
 *   party: PartyId;                    // <- NEW
 *   numWinners: number;                // <- NEW
 *   numRunoff: number;                 // <- NEW
 *   name: string;
 *   contestType: string;               // <- NEW
 *   description: string;
 *   note: string;
 * }
 * ```
 *
 * NOTE: This atom is a multi-source atom, meaning that you should not use the
 * atom directly. It is a stub for the `contestMetadata` selector.
 */
const contestMetadata = atomFamily({
  key: 'int-style.election.atoms.contestMetadata',
  default: undefined
});
export default contestMetadata;