import React from 'react';

import * as AppPokemonIndexQuery from '../../../__generated__/AppPokemonIndexQuery.graphql';
import PokemonShow from './Show';

function PokemonIndex(props: AppPokemonIndexQuery.AppPokemonIndexQueryResponse): React.ReactElement<void> {
  return (
    <ul>
      {props.pokemonConnection.edges.map(
        (edge): React.ReactNode => (
          <li key={edge.node.id}>
            <PokemonShow pokemon={edge.node} />
          </li>
        )
      )}
    </ul>
  );
}

export default PokemonIndex;
