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 (
Случайные рекомендации из общей библиотеки. Персональные рекомендации появятся позже.
Загрузка рекомендаций...
) : items.length === 0 ? (