import PropTypes from 'prop-types';
import { Districts } from "../../maps/index.js";
import { useGetMapFills } from "../../../hooks/election/index.js";

/**
 * A map of the country displaying results for all house districts.
 */
const NationalDistrictsMap = function NationalDistrictsMap(props) {
  const {
    colors,
    format,
    tooltip,
    ...restProps
  } = props;
  const getDistrictProps = useGetMapFills(colors, format);
  return <Districts getBoundaryProps={getDistrictProps} tooltip={tooltip} displayDistrictsAsDots={format === 'dots'} choroplethLabelStyle="abbr" {...restProps} />;
};
NationalDistrictsMap.defaultProps = {
  format: 'dots',
  tooltip: undefined
};
NationalDistrictsMap.propTypes = {
  /**
   * An object of palettes and legend configurations to show, as returned by `Hooks/getMapFills`
   */
  colors: PropTypes.shape({}).isRequired,
  /**
   * The format the map should display
   */
  format: PropTypes.oneOf(['geo', 'dots']),
  /**
   * The map's tooltip
   */
  tooltip: PropTypes.shape({})
};
export default NationalDistrictsMap;