"use client"; import { useState } from "react"; import { LoadingScreen } from "@/components/ui/LoadingScreen"; import { RefreshCw, AudioWaveform } from "lucide-react"; import { GradientSpinner } from "@/components/ui/GradientSpinner"; import { Badge } from "@/components/ui/Badge"; import { useHomeData } from "@/features/home/hooks/useHomeData"; import { HomeHero } from "@/features/home/components/HomeHero"; import { SectionHeader } from "@/features/home/components/SectionHeader"; import { ContinueListening } from "@/features/home/components/ContinueListening"; import { ArtistsGrid } from "@/features/home/components/ArtistsGrid"; import { MixesGrid } from "@/features/home/components/MixesGrid"; import { PopularArtistsGrid } from "@/features/home/components/PopularArtistsGrid"; import { PodcastsGrid } from "@/features/home/components/PodcastsGrid"; import { AudiobooksGrid } from "@/features/home/components/AudiobooksGrid"; import { FeaturedPlaylistsGrid } from "@/features/home/components/FeaturedPlaylistsGrid"; import { LibraryRadioStations } from "@/features/home/components/LibraryRadioStations"; import { MoodMixer } from "@/components/MoodMixer"; // Loading skeleton for playlist cards function PlaylistSkeleton() { return (
{[...Array(8)].map((_, i) => (
))}
); } export default function HomePage() { const [showMoodMixer, setShowMoodMixer] = useState(false); const { recentlyListened, recentlyAdded, recommended, mixes, popularArtists, recentPodcasts, recentAudiobooks, featuredPlaylists, isLoading, isRefreshingMixes, isBrowseLoading, handleRefreshMixes, } = useHomeData(); if (isLoading) { return ; } return (
{/* Library Radio Stations - Quick shuffle from your library */}
{/* Continue Listening - #1 Priority */} {recentlyListened.length > 0 && (
)} {/* Recently Added - #2 Priority */} {recentlyAdded.length > 0 && (
)} {/* Made For You - #3 Priority */} {mixes.length > 0 && (
} /> )} {/* Recommended For You - #4 Priority */} {recommended.length > 0 && (
)} {/* Popular Artists - #5 Priority */} {popularArtists.length > 0 && (
)} {/* Featured Playlists - After Popular Artists */} {(isBrowseLoading || featuredPlaylists.length > 0) && (
{isBrowseLoading && featuredPlaylists.length === 0 ? ( ) : ( )}
)} {/* Popular Podcasts - #6 Priority */} {recentPodcasts.length > 0 && (
)} {/* Audiobooks - #7 Priority */} {recentAudiobooks.length > 0 && (
)}
{/* Mood Mixer Modal */} setShowMoodMixer(false)} />
); }