import { motion } from 'framer-motion'; import { useState, useEffect } from 'react'; import { useParams, useNavigate } from 'react-router-dom'; import { ArrowLeft, Play } from 'lucide-react'; // 모바일 앨범 상세 페이지 function MobileAlbumDetail() { const { name } = useParams(); const navigate = useNavigate(); const [album, setAlbum] = useState(null); const [tracks, setTracks] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { // 앨범 정보 로드 fetch('/api/albums') .then(res => res.json()) .then(data => { const found = data.find(a => a.folder_name === name); if (found) { setAlbum(found); // 트랙 정보 로드 fetch(`/api/albums/${found.id}/tracks`) .then(res => res.json()) .then(setTracks) .catch(console.error); } setLoading(false); }) .catch(console.error); }, [name]); if (loading) { return (
앨범을 찾을 수 없습니다
{album.album_type}
{album.release_date}
{album.description}