import useSWR from "swr"; const API_URL = "https://api.projectcvsa.com"; export default function SongInfo() { const { data, error, isLoading } = useSWR(`${API_URL}/song/[id]/info`, async (url) => { const response = await fetch(url); if (!response.ok) { throw new Error("Failed to fetch song info"); } return response.json(); }); if (isLoading) return
加载中...
; if (error) return
错误: {error.message}
; if (!data) return
暂无数据
; return (

歌曲信息

{JSON.stringify(data, null, 2)}
); }