import { atomFamily } from 'recoil';

/**
 * Atom family for storing the metadata for an individual candidate. The family
 * key is a compound key made from the contest ID and the candidate ID.
 *
 * ```
 * {
 *   id: CandidateId;
 *   contestId: ContestId;
 *   fullName: string;
 *   shortName: string;
 *   party: string;
 *   fullPartyName: string;
 *   ballotOrder: number;
 *   editorialOrder: number;
 *   isIncumbent: boolean;
 *   polarity: boolean;
 *   description: string;
 * }
 * ```
 *
 * NOTE: This atom is a multi-source atom, meaning that you should not use the
 * atom directly. It is a stub for the `candidateMetadata` selector.
 */
const candidateMetadata = atomFamily({
  key: 'int-style.election.atoms.candidateMetadata',
  default: undefined
});
export default candidateMetadata;