import PropTypes from 'prop-types';
import States from "../States/index.js";
import cartoShapes from './states_carto.asset.json';

/**
 * SVG content component to render a cartogram of all states in the country.
 */
const StatesCarto = function StatesCarto(props) {
  return <States topo={cartoShapes} mapName="carto" {...props} />;
};
StatesCarto.defaultProps = {
  getBoundaryProps: undefined,
  getLabelProps: undefined,
  sortBoundariesCompare: undefined,
  labelStyle: 'abbr',
  tooltip: undefined
};
StatesCarto.propTypes = {
  /**
   * An accessor function to generate props for a specific boundary
   */
  getBoundaryProps: PropTypes.func,
  /**
   * An accessor function to generate props for a specific boundary's label
   */
  getLabelProps: PropTypes.func,
  /**
   * Function to sort the order in which the states are drawn. This function
   * is invoked as a sorting comparator, which receives the properties of two
   * state boundaries and should return -1, 0 or 1 depending on the order in
   * which the two should be relatively sorted.
   */
  sortBoundariesCompare: PropTypes.func,
  /**
   * The label style to use, either AP abbreviations or postal codes
   */
  labelStyle: PropTypes.oneOf(['ap_abbr', 'abbr']),
  /**
   * A tooltip object
   */
  tooltip: PropTypes.shape({})
};
export default StatesCarto;