import React from 'react'; import { useState } from "react"; import { Button } from "../common/index"; export default function InputBox({ onSend, loading }) { const [text, setText] = useState(""); const handleSend = () => { if (!text.trim() || loading) return; onSend(text.trim()); setText(""); }; return (
setText(e.target.value)} onKeyDown={(e) => e.key === "Enter" && handleSend()} placeholder="Ask something about your document…" disabled={loading} className="flex-1 rounded-lg border border-gray-200 px-4 py-2.5 text-sm focus:outline-none focus:ring-2 focus:ring-blue-400 disabled:opacity-50" />
); }