diff --git a/src/app/music/page.tsx b/src/app/music/page.tsx index d47c7c6..77ff900 100644 --- a/src/app/music/page.tsx +++ b/src/app/music/page.tsx @@ -1,20 +1,18 @@ 'use client'; import { useEffect, useState } from 'react'; import { - Typography, List, ListItem, ListItemText, Button, Input, + List, ListItem, ListItemText, ListItemButton, ListItemIcon, Grid, useTheme } from '@mui/material'; -import UploadIcon from '@mui/icons-material/Upload'; import AudioPlayer from '@/components/AudioPlayer/AudioPlayer'; import AudiotrackIcon from '@mui/icons-material/Audiotrack'; export default function Home() { const [tracks, setTracks] = useState([]); const [currentTrack, setCurrentTrack] = useState(null); - const [uploading, setUploading] = useState(false); const theme = useTheme(); @@ -28,51 +26,12 @@ export default function Home() { setTracks(data); }; - const handleUpload = async (e: React.ChangeEvent) => { - if (!e.target.files?.length) return; - const formData = new FormData(); - formData.append('file', e.target.files[0]); - setUploading(true); - const res = await fetch('/api/upload', { - method: 'POST', - body: formData, - }); - setUploading(false); - if (res.ok) { - fetchTracks(); - } else { - console.error(res.status, res.text()) - } - }; - return ( - - - Music - - - - - The grizzly made some tunes while he was bored grazing the blueberry patches in the high dessert. - - - diff --git a/src/components/AudioPlayer/AudioPlayer.tsx b/src/components/AudioPlayer/AudioPlayer.tsx index 94b0b6f..305945c 100644 --- a/src/components/AudioPlayer/AudioPlayer.tsx +++ b/src/components/AudioPlayer/AudioPlayer.tsx @@ -52,14 +52,14 @@ export default function AudioPlayer({ src, title }: { src: string; title: string mx: 'auto', }} > + {title} { coverUrl ? ( - + ) : ( ) } - {title} {playing ? : }