import React from 'react';
import PropTypes from 'prop-types';
import CardApartments from '../CardApartments/CardApartments'
import CardHouses from '../CardHouses/CardHouses';
import CardTownHouses from '../CardTownHouses/CardTownHouses';
const ScrappeResult = ({result, type, index}) => {
    console.log(index);
    return (
        <>    
        <div className='col-lg-12'>       
            {    (type !== undefined && type !== null) ?     
                      
                    (type.value === "apartments") ? <CardApartments index = {index} result={result} />
                                        : (type.value === "houses") ? <CardHouses index ={index} result={result} /> 
                                        : <CardTownHouses index={index} result={result} />
                    : <CardApartments index = {index} result={result} />
            }
            </div>
        </>
    );

}
ScrappeResult.propTypes = {
    result: PropTypes.object,
    type: PropTypes.object,
    index :PropTypes.number
  };
export default ScrappeResult;