diff --git a/src/components/EventCommentSection/CommentInput.js b/src/components/EventCommentSection/CommentInput.js new file mode 100644 index 00000000..0f5d9009 --- /dev/null +++ b/src/components/EventCommentSection/CommentInput.js @@ -0,0 +1,77 @@ +// src/components/EventCommentSection/CommentInput.js +/** + * 评论输入框组件 + * 功能:输入评论内容、字数限制、发布按钮 + */ + +import React from 'react'; +import { + Box, + Textarea, + Button, + HStack, + Text, + useColorModeValue, +} from '@chakra-ui/react'; + +const CommentInput = ({ + value, + onChange, + onSubmit, + isSubmitting, + maxLength = 500, + placeholder = '说点什么...', +}) => { + const bgColor = useColorModeValue('white', 'gray.800'); + const borderColor = useColorModeValue('gray.200', 'gray.600'); + const textColor = useColorModeValue('gray.600', 'gray.400'); + const countColor = useColorModeValue('gray.500', 'gray.500'); + + const handleKeyDown = (e) => { + // Ctrl/Cmd + Enter 快捷键提交 + if ((e.ctrlKey || e.metaKey) && e.key === 'Enter') { + onSubmit(); + } + }; + + return ( + +