import React, { lazy, Suspense } from 'react' import { createRoot } from 'react-dom/client' // Below-fold — lazy-loaded to keep initial bundle small const HomeWelcomeRow = lazy(() => import('./HomeWelcomeRow')) const HomeFromFollowing = lazy(() => import('./HomeFromFollowing')) const HomeTrendingForYou = lazy(() => import('./HomeTrendingForYou')) const HomeBecauseYouLike = lazy(() => import('./HomeBecauseYouLike')) const HomeSuggestedCreators = lazy(() => import('./HomeSuggestedCreators')) const HomeTrending = lazy(() => import('./HomeTrending')) const HomeRising = lazy(() => import('./HomeRising')) const HomeFresh = lazy(() => import('./HomeFresh')) const HomeCollections = lazy(() => import('./HomeCollections')) const HomeCategories = lazy(() => import('./HomeCategories')) const HomeTags = lazy(() => import('./HomeTags')) const HomeCreators = lazy(() => import('./HomeCreators')) const HomeNews = lazy(() => import('./HomeNews')) const HomeCTA = lazy(() => import('./HomeCTA')) function SectionFallback() { return (
) } function GuestHomePage(props) { const { rising, trending, fresh, tags, creators, news, collections_featured, collections_trending, collections_editorial, collections_community } = props return ( <> }> }> {/* 3. Fresh Uploads */} }> }> {/* 4. Explore Categories */} }> {/* 5. Popular Tags */} }> {/* 6. Top Creators */} }> {/* 7. News */} }> {/* 8. CTA Upload */} }> ) } function AuthHomePage(props) { const { user_data, for_you, from_following, rising, trending, fresh, collections_featured, collections_recent, collections_trending, collections_editorial, collections_community, by_categories, suggested_creators, tags, creators, news, preferences, } = props return ( <> {/* P0. Welcome/status row — below hero so featured image sits at 0px */} {/* P2. From Creators You Follow */} }> {/* P3. Personalized For You preview */} }> {/* Rising Now */} }> {/* 2. Global Trending Now */} }> {/* P4. Because You Like {top tag} — uses by_categories for variety */} }> {/* 3. Fresh Uploads */} }> }> {/* 4. Explore Categories */} }> {/* P5. Suggested Creators */} }> {/* 5. Popular Tags */} }> {/* 6. Top Creators */} }> {/* 7. News */} }> {/* 8. CTA Upload */} }> ) } function HomePage(props) { return (
{props.is_logged_in ? : }
) } // Auto-mount when the Blade view provides #homepage-root const mountEl = document.getElementById('homepage-root') if (mountEl) { let props = {} try { const propsEl = document.getElementById('homepage-props') props = propsEl ? JSON.parse(propsEl.textContent || '{}') : {} } catch { props = {} } createRoot(mountEl).render() } export default HomePage