@@ -217,9 +217,10 @@ export default function ChatInterface() {
217
217
} ;
218
218
219
219
return (
220
- < div className = "flex flex-col h-[80vh] bg-gray-100 rounded-lg overflow-hidden border border-gray-300 shadow-lg w-full max-w-[95vw]" >
221
- < div className = "p-3 bg-gray-800 text-white text-sm flex items-center justify-between" >
222
- < span > AgentAPI Chat</ span >
220
+ < div className = "flex flex-col h-svh" >
221
+ < header className = "p-3 dark:text-white text-sm flex items-center justify-between border-b" >
222
+ < span className = "font-medium" > AgentAPI Chat</ span >
223
+
223
224
< div className = "flex items-center space-x-3" >
224
225
< div className = "flex items-center" >
225
226
< span
@@ -232,52 +233,53 @@ export default function ChatInterface() {
232
233
< span > Status: { serverStatus } </ span >
233
234
</ div >
234
235
</ div >
235
- </ div >
236
-
237
- { ( serverStatus === "offline" || serverStatus === "unknown" ) && (
238
- < div className = "bg-yellow-100 border-y border-yellow-400 text-yellow-800 px-4 py-3 flex items-center justify-between font-medium" >
239
- < div className = "flex items-center" >
240
- < svg
241
- className = "w-5 h-5 mr-2"
242
- fill = "currentColor"
243
- viewBox = "0 0 20 20"
244
- xmlns = "http://www.w3.org/2000/svg"
236
+ </ header >
237
+
238
+ < main className = "flex flex-1 flex-col w-full max-w-4xl mx-auto overflow-auto pb-4" >
239
+ { ( serverStatus === "offline" || serverStatus === "unknown" ) && (
240
+ < div className = "bg-yellow-100 border-y border-yellow-400 text-yellow-800 px-4 py-3 flex items-center justify-between font-medium" >
241
+ < div className = "flex items-center" >
242
+ < svg
243
+ className = "w-5 h-5 mr-2"
244
+ fill = "currentColor"
245
+ viewBox = "0 0 20 20"
246
+ xmlns = "http://www.w3.org/2000/svg"
247
+ >
248
+ < path
249
+ fillRule = "evenodd"
250
+ d = "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
251
+ clipRule = "evenodd"
252
+ />
253
+ </ svg >
254
+ < span >
255
+ API server is offline. Please start the AgentAPI server.
256
+ Attempting to connect to: { agentAPIUrl || "N/A" } .
257
+ </ span >
258
+ </ div >
259
+ < button
260
+ onClick = { ( ) => window . location . reload ( ) }
261
+ className = "bg-yellow-200 px-3 py-1 rounded text-xs hover:bg-yellow-300"
245
262
>
246
- < path
247
- fillRule = "evenodd"
248
- d = "M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z"
249
- clipRule = "evenodd"
250
- />
251
- </ svg >
252
- < span >
253
- API server is offline. Please start the AgentAPI server.
254
- Attempting to connect to: { agentAPIUrl || "N/A" } .
255
- </ span >
263
+ Retry Connection
264
+ </ button >
256
265
</ div >
257
- < button
258
- onClick = { ( ) => window . location . reload ( ) }
259
- className = "bg-yellow-200 px-3 py-1 rounded text-xs hover:bg-yellow-300"
260
- >
261
- Retry Connection
262
- </ button >
263
- </ div >
264
- ) }
265
-
266
- { error && (
267
- < div className = "bg-red-100 border border-red-400 text-red-700 px-4 py-2 text-sm relative" >
268
- < span className = "block sm:inline" > { error } </ span >
269
- < button
270
- onClick = { ( ) => setError ( null ) }
271
- className = "absolute top-0 bottom-0 right-0 px-4 py-2"
272
- >
273
- ×
274
- </ button >
275
- </ div >
276
- ) }
277
-
278
- < MessageList messages = { messages } loading = { loading } />
266
+ ) }
267
+
268
+ { error && (
269
+ < div className = "bg-red-100 border border-red-400 text-red-700 px-4 py-2 text-sm relative" >
270
+ < span className = "block sm:inline" > { error } </ span >
271
+ < button
272
+ onClick = { ( ) => setError ( null ) }
273
+ className = "absolute top-0 bottom-0 right-0 px-4 py-2"
274
+ >
275
+ ×
276
+ </ button >
277
+ </ div >
278
+ ) }
279
279
280
- < MessageInput onSendMessage = { sendMessage } disabled = { loading } />
280
+ < MessageList messages = { messages } loading = { loading } />
281
+ < MessageInput onSendMessage = { sendMessage } disabled = { loading } />
282
+ </ main >
281
283
</ div >
282
284
) ;
283
285
}
0 commit comments