diff --git a/package.json b/package.json index 002ab2b..2e73cd3 100644 --- a/package.json +++ b/package.json @@ -10,8 +10,12 @@ "preview": "vite preview" }, "dependencies": { + "@ant-design/icons": "^6.1.0", + "@ant-design/v5-patch-for-react-19": "^1.0.3", + "antd": "^5.27.0", "react": "^19.1.1", - "react-dom": "^19.1.1" + "react-dom": "^19.1.1", + "react-router-dom": "^6.30.1" }, "devDependencies": { "@eslint/js": "^9.36.0", diff --git a/src/App.tsx b/src/App.tsx index 3d7ded3..081172b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,35 +1,8 @@ -import { useState } from 'react' -import reactLogo from './assets/react.svg' -import viteLogo from '/vite.svg' -import './App.css' +import React from 'react'; +import LayoutWrapper from './components/LayoutWrapper'; function App() { - const [count, setCount] = useState(0) - - return ( - <> -
- - Vite logo - - - React logo - -
-

Vite + React

-
- -

- Edit src/App.tsx and save to test HMR -

-
-

- Click on the Vite and React logos to learn more -

- - ) + return ; } -export default App +export default App; diff --git a/src/components/HintText.css b/src/components/HintText.css new file mode 100644 index 0000000..cf451de --- /dev/null +++ b/src/components/HintText.css @@ -0,0 +1,2 @@ +/* 提示信息组件样式 */ +/* 文字样式在 layout.css 的 .hint-text 中定义,此处预留扩展 */ \ No newline at end of file diff --git a/src/components/HintText.tsx b/src/components/HintText.tsx new file mode 100644 index 0000000..34fabd3 --- /dev/null +++ b/src/components/HintText.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import './HintText.css'; + +const HintText: React.FC = () => { + return ( +
+ 提示:支持输入多行文本与上传图片。按 Enter 发送,Shift+Enter 换行。 +
+ ); +}; + +export default HintText; \ No newline at end of file diff --git a/src/components/InputPanel.css b/src/components/InputPanel.css new file mode 100644 index 0000000..d7f9799 --- /dev/null +++ b/src/components/InputPanel.css @@ -0,0 +1,19 @@ +/* 输入面板组件样式 */ +.input-panel { + display: flex; + flex-direction: column; + gap: 8px; +} + +.input-panel .ant-input-outlined, +.input-panel .ant-input { + background: rgba(255,255,255,0.04); + color: #e5e7eb; +} + +.input-actions { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 8px; +} \ No newline at end of file diff --git a/src/components/InputPanel.tsx b/src/components/InputPanel.tsx new file mode 100644 index 0000000..136e8b7 --- /dev/null +++ b/src/components/InputPanel.tsx @@ -0,0 +1,64 @@ +import React from 'react'; +import { Input, Upload, message, Button } from 'antd'; +import { PictureOutlined, SendOutlined } from '@ant-design/icons'; +import './InputPanel.css'; + +const { TextArea } = Input; + +const InputPanel: React.FC = () => { + const [value, setValue] = React.useState(''); + const [fileList, setFileList] = React.useState([]); + + const send = () => { + const hasText = value.trim().length > 0; + const hasImage = fileList.length > 0; + if (!hasText && !hasImage) { + message.info('请输入内容或上传图片'); + return; + } + // 此处替换为真实发送逻辑 + console.log('发送内容:', { text: value, files: fileList }); + setValue(''); + setFileList([]); + message.success('已发送'); + }; + + const onKeyDown = (e: React.KeyboardEvent) => { + if (e.key === 'Enter') { + if (e.shiftKey) { + // Shift+Enter 换行(保持默认行为) + return; + } + // Enter 发送 + e.preventDefault(); + send(); + } + }; + + return ( +
+