import { Button, Textarea } from '@heroui/react'; import { CircleStopIcon, SendIcon } from 'lucide-react'; interface Props { onSend: (query: string) => void; onStop: () => void; running?: boolean; value: string; onChange: (value: string) => void; } export const isMobile = ((): boolean => { const userAgent = typeof window !== 'undefined' ? window?.navigator?.userAgent?.toLowerCase() : ''; const mobileRegex = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini|mobile|tablet/i; return mobileRegex.test(userAgent); })(); export const MsgSend = ({ onSend, onStop, running = false, value, onChange, }: Props) => { const isEmptyInput = value.trim().length === 0; const handleSend = () => { if (value) { onSend(value); onChange(''); // 发送后清空输入框 } }; return ( <>