Spaces:
Runtime error
Runtime error
File size: 889 Bytes
6a317c1 a74762c 6a317c1 d32544a 6a317c1 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
import React from 'react';
import GlassButton from './ui/GlassButton';
interface MessageInputProps {
value: string;
onChange: (value: string) => void;
onSend: () => void;
disabled?: boolean;
}
export default function MessageInput({ value, onChange, onSend, disabled }: MessageInputProps) {
const handleSubmit = (e: React.FormEvent) => {
e.preventDefault();
onSend();
};
return (
<form onSubmit={handleSubmit} className="flex gap-2 p-2 border-t border-gray-200">
<input
type="text"
className="flex-1 bg-white/60 backdrop-blur-sm border border-gray-300 text-gray-900 px-3 py-2 rounded-md focus:outline-none"
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder="Type your message..."
/>
<GlassButton type="submit" disabled={disabled}>
Send
</GlassButton>
</form>
);
}
|