mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-05 16:23:36 +00:00
media drag and drop in chat view
This commit is contained in:
1 parent
eb381bc37e
commit
7a4cd6cd00
1 file changed
+16
-1
@@ -89,6 +89,21 @@ export const ChatInput = memo(function ChatInput({
|
||||
setInput(e.target.value);
|
||||
}, []);
|
||||
|
||||
const handleDrop = useCallback((e: React.DragEvent) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
// Call parent's drop handler for visual state management
|
||||
onDrop(e);
|
||||
|
||||
// Extract files from the drop event
|
||||
const files = Array.from(e.dataTransfer.files);
|
||||
if (files.length === 0) return;
|
||||
|
||||
// Add all files without validation
|
||||
setAttachedFiles(prev => [...prev, ...files]);
|
||||
}, [onDrop]);
|
||||
|
||||
return (
|
||||
<div className="border-t p-4">
|
||||
{/* Chat Input Container */}
|
||||
@@ -99,7 +114,7 @@ export const ChatInput = memo(function ChatInput({
|
||||
onDragEnter={onDragEnter}
|
||||
onDragOver={onDragOver}
|
||||
onDragLeave={onDragLeave}
|
||||
onDrop={onDrop}
|
||||
onDrop={handleDrop}
|
||||
>
|
||||
<Textarea
|
||||
value={input}
|
||||
|
||||
Reference in new issue
Block a user