diff --git a/web/src/components/ChatBox/ChatInputBox/Addon.tsx b/web/src/components/ChatBox/ChatInputBox/Addon.tsx
index 3b6e14c3..1b477aed 100644
--- a/web/src/components/ChatBox/ChatInputBox/Addon.tsx
+++ b/web/src/components/ChatBox/ChatInputBox/Addon.tsx
@@ -1,23 +1,40 @@
-import { chatInputActions } from '@/plugin/common';
+import { FileSelector } from '@/components/FileSelector';
+import { pluginChatInputActions } from '@/plugin/common';
import { Icon } from '@iconify/react';
import { Dropdown, Menu } from 'antd';
import React from 'react';
+import { t } from 'tailchat-shared';
import { useChatInputActionContext } from './context';
+import { uploadMessageImage } from './utils';
export const ChatInputAddon: React.FC = React.memo(() => {
const actionContext = useChatInputActionContext();
-
- if (chatInputActions.length === 0) {
- return null;
- }
-
if (actionContext === null) {
return null;
}
+ const handleSendImage = (files: FileList) => {
+ // 发送图片
+ const image = files[0];
+ if (image) {
+ // 发送图片
+ uploadMessageImage(image).then((imageRemoteUrl) => {
+ // TODO: not good, should bind with plugin bbcode
+ actionContext.sendMsg(`[img]${imageRemoteUrl}[/img]`);
+ });
+ }
+ };
+
const menu = (