diff --git a/client/ui/chat/ChatFragment.tsx b/client/ui/chat/ChatFragment.tsx index 61a8b49..fb8d6e7 100644 --- a/client/ui/chat/ChatFragment.tsx +++ b/client/ui/chat/ChatFragment.tsx @@ -180,14 +180,24 @@ export default function ChatFragment({ target, ...props }: Args) { alignItems: 'center', paddingBottom: '2px', paddingTop: '0.1rem', - height: '4rem', position: 'sticky', bottom: '0', marginLeft: '5px', marginRight: '4px', backgroundColor: 'rgb(var(--mdui-color-background))', + }} onDrop={(e) => { + if (e.dataTransfer.files) { + const files = e.dataTransfer.files + // 基于当前的实现, 浏览器不会读取文件的字节流来确定其媒体类型, 其根据文件扩展名进行假设 + // https://developer.mozilla.org/zh-CN/docs/Web/API/Blob/type + for (const file of files) { + if (file.type.startsWith("image/")) { + + } + } + } }}> - { + { if (event.ctrlKey && event.key == 'Enter') sendMessage() }} style={{