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 = {
  states: [],
  labelStyle: 'abbr',
  tooltip: undefined
};
StatesCarto.propTypes = {
  /**
   * An array of pairs of state codes and color names
   */
  states: PropTypes.arrayOf(PropTypes.shape({
    color: PropTypes.string,
    code: PropTypes.string
  })),
  /**
   * 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;