import { motion } from 'framer-motion'; import { useQuery } from '@tanstack/react-query'; import { useNavigate } from 'react-router-dom'; import { getAlbums } from '@/api/albums'; /** * Mobile 앨범 목록 페이지 */ function MobileAlbum() { const navigate = useNavigate(); const { data: albums = [], isLoading: loading } = useQuery({ queryKey: ['albums'], queryFn: getAlbums, }); if (loading) { return (
); } return (
{albums.map((album, index) => ( navigate(`/album/${encodeURIComponent(album.title)}`)} className="bg-white rounded-2xl overflow-hidden shadow-md" >
{album.cover_thumb_url && ( {album.title} )}

{album.title}

{album.album_type_short} · {album.release_date?.slice(0, 4)}

))}
); } export default MobileAlbum;