/** * EditDropzone - Initial upload area for the Edit tab. * * Single primary action: upload an image to start editing. * Avatar creation has moved to the dedicated Avatar tab. */ import React, { useCallback, useState } from 'react'; import { Image as ImageIcon, Upload } from 'lucide-react'; export function EditDropzone({ onPickFile, disabled }) { const [isDragging, setIsDragging] = useState(false); const handleDragOver = useCallback((e) => { e.preventDefault(); e.stopPropagation(); if (!disabled) { setIsDragging(true); } }, [disabled]); const handleDragLeave = useCallback((e) => { e.preventDefault(); e.stopPropagation(); setIsDragging(false); }, []); const handleDrop = useCallback((e) => { e.preventDefault(); e.stopPropagation(); setIsDragging(false); if (disabled) return; const file = e.dataTransfer.files?.[0]; if (file && file.type.startsWith('image/')) { onPickFile(file); } }, [onPickFile, disabled]); const handleFileChange = useCallback((e) => { const file = e.target.files?.[0]; if (file) { onPickFile(file); } // Reset input to allow re-selecting the same file e.currentTarget.value = ''; }, [onPickFile]); return (
{/* Icon */}
{/* Title */}

Start editing

{/* Description */}

Upload an image to start editing with AI-powered tools.

{/* Upload action */}
{/* Drag hint */}

Supports PNG, JPEG, and WebP — drag & drop or click Upload

); } export default EditDropzone;