import { LocationCard, SeparatorWithAnchor } from '../../components'; import popular from '../../datas/popular.json'; import './style.css'; import { useHome } from './useHome'; import { User } from 'lucide-react'; function Home() { const { recentLocations, topCriticsLocations, topUsersLocations, onNavigateToDetail, } = useHome(); return (
{/* RECENTLY ADDED SECTION */}
{recentLocations.map((x) => ( //
// onNavigateToDetail(x.id)}> //
// {x.name} //
//
//
//

{x.name}

//

{x.regency_name}, {x.province_name}

//
// {x.critic_count !== 0 && //
//
//

{x.critic_score}

//
//
//
//
//

critic score ({x.critic_count})

//
// } // {x.user_score !== 0 && //
//
//

{x.user_score}

//
//
//
//
//

user score ({x.user_count})

//
// } //
))}
{/* END RECENTLY ADDED SECTION */} {/* START RECENT NEWS / EVENT SECTION */} {/* USE OPEN GRAPH PARSER TO READ OG DATA FROM HTML */} {/* https://github.com/dyatlov/go-opengraph */} {/*
{news.data.map((x: News) => (
{x.link.split("/")[2].replace(/www\./, '')}

{x.header}

{x.likes_count}

{x.comments_count}

)) }
*/} {/* END RECENT NEWS / EVENT SECTION */} {/* LOCATION CRITICS BEST AND USERS BEST SECTION */} {/*
{popular_user_review.data.map((x) => (

{x.place_name}

{x.location}

{x.username}

{x.rating}

{x.message} read more
)) }
*/} {/* START LOCATION CRITICS BEST AND USERS BEST SECTION */}
{popular.data.map((x) => (
{ e.currentTarget.src = 'https://pub-6b637ea51b64436dbf0514bc956972d1.r2.dev/public/upload/misty-forest-black-white.webp'; e.currentTarget.onerror = null; }} />

{x.name}

{x.location}

1.2k users visit this month

))}
{topCriticsLocations.map((x) => (
{ e.currentTarget.src = x.location_type === 'culinary' ? 'https://pub-6b637ea51b64436dbf0514bc956972d1.r2.dev/restaorunta.webp' : 'https://pub-6b637ea51b64436dbf0514bc956972d1.r2.dev/public/upload/misty-forest-black-white.webp'; e.currentTarget.onerror = null; }} />

{x.name}

{x.regency_name}

{x.critic_score}

({x.critic_count} )
)) }
{topUsersLocations.map((x) => (
{ e.currentTarget.src = x.location_type === 'culinary' ? 'https://pub-6b637ea51b64436dbf0514bc956972d1.r2.dev/restaorunta.webp' : 'https://pub-6b637ea51b64436dbf0514bc956972d1.r2.dev/public/upload/misty-forest-black-white.webp'; e.currentTarget.onerror = null; }} />

{x.name}

{x.regency_name}

{x.user_score}

({x.user_count} )
)) }
) } export default Home;