Fix AI chat page: add back button, disable send while loading

- Add back link (←) to /menu in header
- Send button: gray out while loading to prevent double-click

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Manohar Gupta 2026-05-11 01:32:22 +05:30
parent 049a496f7f
commit f8df3ce313

View file

@ -138,6 +138,7 @@ export default function AIChatPage() {
{/* Main chat */} {/* Main chat */}
<div className="flex-1 flex flex-col"> <div className="flex-1 flex flex-col">
<div className="p-4 flex items-center border-b bg-white"> <div className="p-4 flex items-center border-b bg-white">
<a href="/menu" className="p-2"></a>
<button onClick={() => setSidebarOpen(!sidebarOpen)} className="p-2"></button> <button onClick={() => setSidebarOpen(!sidebarOpen)} className="p-2"></button>
<span className="ml-2 font-medium">{currentSession?.title || "AI Chat"}</span> <span className="ml-2 font-medium">{currentSession?.title || "AI Chat"}</span>
</div> </div>
@ -160,7 +161,7 @@ export default function AIChatPage() {
className="flex-1 p-3 border rounded-lg" className="flex-1 p-3 border rounded-lg"
disabled={loading} disabled={loading}
/> />
<button onClick={handleSend} disabled={loading} className="px-4 py-2 bg-rose-400 text-white rounded-lg"> <button onClick={handleSend} disabled={loading} className={`px-4 py-2 text-white rounded-lg ${loading ? "bg-gray-300 cursor-not-allowed" : "bg-rose-400"}`}>
{loading ? "..." : "Send"} {loading ? "..." : "Send"}
</button> </button>
</div> </div>