|
|
@@ -109,77 +109,79 @@ export const ChatInterface = () => {
|
|
|
}
|
|
|
|
|
|
return (
|
|
|
- <div className="max-w-5xl mx-auto p-6">
|
|
|
- <div className="bg-card rounded-xl shadow-lg border border-border">
|
|
|
- {/* Header */}
|
|
|
- <ChatHeader
|
|
|
- remainingMessages={remainingMessages}
|
|
|
- isLastMessage={isLastMessage}
|
|
|
- isGeneratingReport={isGeneratingReport}
|
|
|
- messages={messages}
|
|
|
- isLimitReached={isLimitReached}
|
|
|
- isLoading={isLoading}
|
|
|
- onResetClick={handleResetClick}
|
|
|
- />
|
|
|
-
|
|
|
- <div className="flex flex-col h-[600px]">
|
|
|
- {/* Chat Content */}
|
|
|
- <div className="flex-1 overflow-hidden">
|
|
|
- <div className="h-full overflow-y-auto p-6 space-y-6">
|
|
|
- {/* Completed Banner */}
|
|
|
- {showCompletedBanner && (
|
|
|
- <CompletedBanner
|
|
|
- isGeneratingReport={isGeneratingReport}
|
|
|
- onDismiss={dismissCompletedBanner}
|
|
|
+ <div className="min-h-screen flex items-center justify-center p-6">
|
|
|
+ <div className="w-full max-w-6xl mx-auto">
|
|
|
+ <div className="bg-card rounded-xl shadow-lg border border-border">
|
|
|
+ {/* Header */}
|
|
|
+ <ChatHeader
|
|
|
+ remainingMessages={remainingMessages}
|
|
|
+ isLastMessage={isLastMessage}
|
|
|
+ isGeneratingReport={isGeneratingReport}
|
|
|
+ messages={messages}
|
|
|
+ isLimitReached={isLimitReached}
|
|
|
+ isLoading={isLoading}
|
|
|
+ onResetClick={handleResetClick}
|
|
|
+ />
|
|
|
+
|
|
|
+ <div className="flex flex-col min-h-[70vh]">
|
|
|
+ {/* Chat Content */}
|
|
|
+ <div className="flex-1 overflow-hidden">
|
|
|
+ <div className="h-full overflow-y-auto p-6 space-y-6">
|
|
|
+ {/* Completed Banner */}
|
|
|
+ {showCompletedBanner && (
|
|
|
+ <CompletedBanner
|
|
|
+ isGeneratingReport={isGeneratingReport}
|
|
|
+ onDismiss={dismissCompletedBanner}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* Welcome Message */}
|
|
|
+ {messages.length === 0 && (
|
|
|
+ <WelcomeMessage maxMessages={MAX_MESSAGES} />
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* Suggested Prompts */}
|
|
|
+ {showSuggestions && messages.length === 0 && (
|
|
|
+ <SuggestedPrompts
|
|
|
+ onSuggestionClick={handleSuggestionClick}
|
|
|
+ isLoading={isLoading}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+
|
|
|
+ {/* Messages */}
|
|
|
+ <ChatMessages
|
|
|
+ messages={messages}
|
|
|
+ isLoading={isLoading}
|
|
|
+ showDynamicSuggestions={showDynamicSuggestions}
|
|
|
/>
|
|
|
- )}
|
|
|
-
|
|
|
- {/* Welcome Message */}
|
|
|
- {messages.length === 0 && (
|
|
|
- <WelcomeMessage maxMessages={MAX_MESSAGES} />
|
|
|
- )}
|
|
|
-
|
|
|
- {/* Suggested Prompts */}
|
|
|
- {showSuggestions && messages.length === 0 && (
|
|
|
- <SuggestedPrompts
|
|
|
- onSuggestionClick={handleSuggestionClick}
|
|
|
- isLoading={isLoading}
|
|
|
- />
|
|
|
- )}
|
|
|
+
|
|
|
+ {/* Dynamic Suggestions */}
|
|
|
+ {showDynamicSuggestions && currentSuggestions.length > 0 && !isLoading && (
|
|
|
+ <DynamicSuggestions
|
|
|
+ suggestions={currentSuggestions}
|
|
|
+ onSuggestionClick={handleSuggestionClick}
|
|
|
+ isLoading={isLoading}
|
|
|
+ />
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
|
|
|
- {/* Messages */}
|
|
|
- <ChatMessages
|
|
|
- messages={messages}
|
|
|
- isLoading={isLoading}
|
|
|
- showDynamicSuggestions={showDynamicSuggestions}
|
|
|
+ {/* Input Area */}
|
|
|
+ {messageCount < MAX_MESSAGES && (
|
|
|
+ <ChatInput
|
|
|
+ inputMessage={inputMessage}
|
|
|
+ setInputMessage={setInputMessage}
|
|
|
+ onSendMessage={handleSendMessage}
|
|
|
+ isLimitReached={messageCount >= MAX_MESSAGES}
|
|
|
+ isLoading={isLoading || inputDisabledForSuggestions}
|
|
|
/>
|
|
|
-
|
|
|
- {/* Dynamic Suggestions */}
|
|
|
- {showDynamicSuggestions && currentSuggestions.length > 0 && !isLoading && (
|
|
|
- <DynamicSuggestions
|
|
|
- suggestions={currentSuggestions}
|
|
|
- onSuggestionClick={handleSuggestionClick}
|
|
|
- isLoading={isLoading}
|
|
|
- />
|
|
|
- )}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ )}
|
|
|
|
|
|
- {/* Input Area */}
|
|
|
- {messageCount < MAX_MESSAGES && (
|
|
|
- <ChatInput
|
|
|
- inputMessage={inputMessage}
|
|
|
- setInputMessage={setInputMessage}
|
|
|
- onSendMessage={handleSendMessage}
|
|
|
- isLimitReached={messageCount >= MAX_MESSAGES}
|
|
|
- isLoading={isLoading || inputDisabledForSuggestions}
|
|
|
- />
|
|
|
- )}
|
|
|
-
|
|
|
- {/* Reset Button */}
|
|
|
- {messageCount >= MAX_MESSAGES && (
|
|
|
- <ResetButton onReset={handleResetWithReportAndModal} />
|
|
|
- )}
|
|
|
+ {/* Reset Button */}
|
|
|
+ {messageCount >= MAX_MESSAGES && (
|
|
|
+ <ResetButton onReset={handleResetWithReportAndModal} />
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
|