import React from 'react'; import Weather from './Weather'; const Country = ({data,onClick,weather}) => { const list = data.length const clickHandler = (index) => { onClick(index) } return (
{list > 10 ? 'Too many matches, specific another filter' : list > 1 ? data.map((item, index) => clickHandler(index)} weather={weather}/>) : data.map(item => ) }
) } const CountryLongList = ({data, onClick,weather}) => { const show = data.Show console.log(show) return (
{data.name}
{show === true && }
); } const CountryDetail = ({data,weather}) => { return (

{data.name}

Capital: {data.capital}

Population: {data.population}

Languagues

{data.name} {weather.length === 0 ? "" : }
) } export default Country