import React, { useState, useRef } from 'react'; import { Upload, Music, FileAudio } from 'lucide-react'; import './FileUpload.css'; const FileUpload = ({ onFileUpload }) => { const [isDragOver, setIsDragOver] = useState(false); const fileInputRef = useRef(null); const handleDragOver = (e) => { e.preventDefault(); setIsDragOver(true); }; const handleDragLeave = (e) => { e.preventDefault(); setIsDragOver(false); }; const handleDrop = (e) => { e.preventDefault(); setIsDragOver(false); const files = e.dataTransfer.files; if (files.length > 0) { handleFileSelect(files[0]); } }; const handleFileSelect = (file) => { if (file && file.type.startsWith('audio/')) { onFileUpload(file); } else { alert('Please select a valid audio file (MP3, WAV, FLAC, etc.)'); } }; const handleClick = () => { fileInputRef.current?.click(); }; const handleFileInputChange = (e) => { const file = e.target.files[0]; if (file) { handleFileSelect(file); } }; return (

Upload Your Music

Drag and drop an audio file here, or click to browse

MP3
WAV
FLAC
More

How it works

1

Upload your audio file

2

AI separates the tracks

3

Download isolated stems

); }; export default FileUpload;