import { useEffect, useState } from "react"; import axiosInstance from "../api/axiosInstance"; import type { Song } from "../utils/types"; import Nav from "./Nav"; const LandingPage = () => { const [songs, setSongs] = useState([]); const [loading, setLoading] = useState(true); const [isSidebarOpen, setIsSidebarOpen] = useState(true); // mock data for recently listened songs const recentlyListened = [ { id: 1, title: "Song One", artist: "Artist A", cover: "/favicon.png" }, { id: 2, title: "Song Two", artist: "Artist B", cover: "/favicon.png" }, { id: 3, title: "Song Three", artist: "Artist C", cover: "/favicon.png" }, { id: 4, title: "Song Four", artist: "Artist D", cover: "/favicon.png" }, { id: 5, title: "Song Five", artist: "Artist E", cover: "/favicon.png" }, ]; // mock data for my playlists const playlists = [ { id: 1, name: "My Favorites", songCount: 25 }, { id: 2, name: "Workout Mix", songCount: 18 }, { id: 3, name: "Chill Vibes", songCount: 32 }, { id: 4, name: "Party Hits", songCount: 45 }, ]; useEffect(() => { const fetchSongs = async () => { try { const response = await axiosInstance.get("/songs"); const data = response.data; console.log("Fetched songs:", data); setSongs(data); } catch (error) { console.error("Error fetching songs:", error); } finally { setLoading(false); } }; fetchSongs(); }, []); return ( <>