import { useQuery } from "@tanstack/react-query"; import { Play, RefreshCw } from "lucide-react"; import { tracksApi } from "../lib/api"; import { useAuth } from "../store/auth"; import { usePlayer } from "../store/player"; import { TrackRow } from "../components/TrackRow"; export function Home() { const { user } = useAuth(); const playQueue = usePlayer((s) => s.playQueue); const { data, isLoading, isFetching, refetch } = useQuery({ queryKey: ["random-tracks"], queryFn: () => tracksApi.random(25), }); const items = data ?? []; return (

Привет{user?.displayName ? `, ${user.displayName}` : ""} 👋

Случайные рекомендации из общей библиотеки. Персональные рекомендации появятся позже.

{isLoading ? (

Загрузка рекомендаций...

) : items.length === 0 ? (
В библиотеке пока нет одобренных треков. Загрузите музыку на вкладке «Добавить».
) : (
{items.map((track, i) => ( ))}
)}
); }