@@ -15,7 +15,6 @@ import { useAtom } from 'jotai';
1515import { useEffect , useRef , useState } from 'react' ;
1616import { Button } from '@/components/ui/button' ;
1717import { Input } from '@/components/ui/input' ;
18- import { ScrollArea } from '@/components/ui/scroll-area' ;
1918import { Skeleton } from '@/components/ui/skeleton' ;
2019import { cn } from '@/lib/utils' ;
2120import {
@@ -202,20 +201,20 @@ export default function ChatSection() {
202201 </ div >
203202
204203 { /* Messages Area */ }
205- < div className = "relative min-h-0 flex-1 overflow-y-auto" >
206- < ScrollArea className = "h-full" ref = { scrollAreaRef } >
207- < div className = "px-4 py-3" >
208- { /* Welcome State */ }
209- { ! ( hasMessages || isLoading ) && (
210- < div className = "fade-in-0 slide-in-from-bottom-4 animate-in space-y-6 duration-500 " >
211- < div className = "py-8 text-center" >
204+ < div className = "min-h-0 flex-1 overflow-y-auto" ref = { scrollAreaRef } >
205+ { /* Welcome State */ }
206+ < div className = "h-full px-4 py-3" >
207+ { ! ( hasMessages || isLoading ) && (
208+ < div className = "fade-in-0 slide-in-from-bottom-4 h-full animate-in space-y-6 duration-500" >
209+ < div className = "flex h-full flex-col justify-between " >
210+ < div className = "space-y-2 py-4 text-center" >
212211 < div className = "mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-gradient-to-br from-primary/10 to-accent/10" >
213212 < SparkleIcon
214213 className = "h-8 w-8 text-primary"
215214 weight = "duotone"
216215 />
217216 </ div >
218- < h3 className = "mb-2 font-semibold text-lg" >
217+ < h3 className = "font-semibold text-lg" >
219218 Welcome to Databunny
220219 </ h3 >
221220 < p className = "mx-auto max-w-md text-muted-foreground text-sm" >
@@ -226,56 +225,56 @@ export default function ChatSection() {
226225 </ div >
227226
228227 < div className = "space-y-3" >
229- < div className = "mb-3 flex items-center gap-2 text-muted-foreground text-sm" >
228+ < div className = "flex items-center gap-2 text-muted-foreground text-sm" >
230229 < LightningIcon className = "h-4 w-4" weight = "duotone" />
231230 < span > Try these examples:</ span >
232231 </ div >
233- { quickQuestions . map ( ( question , index ) => (
234- < Button
235- className = { cn (
236- 'h-auto w-full justify-start px-4 py-3 text-left font-normal text-sm' ,
237- 'hover:bg-gradient-to-r hover:from-primary/5 hover:to-accent/5' ,
238- 'border-dashed transition-all duration-300 hover:border-solid' ,
239- 'fade-in-0 slide-in-from-left-2 animate-in'
240- ) }
241- disabled = { isLoading || isRateLimited }
242- key = { question . text }
243- onClick = { ( ) => {
244- if ( ! ( isLoading || isRateLimited ) ) {
245- sendMessage ( question . text ) ;
246- scrollToBottom ( ) ;
247- }
248- } }
249- size = "sm"
250- style = { { animationDelay : `${ index * 100 } ms` } }
251- variant = "outline"
252- >
253- < question . icon className = "mr-3 h-4 w-4 flex-shrink-0 text-primary/70" />
254- < div className = "flex-1" >
255- < div className = "font-medium" > { question . text } </ div >
256- < div className = "text-muted-foreground text-xs capitalize" >
257- { question . type } response
232+ < div className = "grid grid-cols-1 gap-2 md:grid-cols-2" >
233+ { quickQuestions . map ( ( question , index ) => (
234+ < Button
235+ className = { cn (
236+ 'h-auto px-4 py-3 text-left font-normal text-sm' ,
237+ 'hover:bg-gradient-to-r hover:from-primary/5 hover:to-accent/5' ,
238+ 'border-dashed transition-all duration-300 hover:border-solid' ,
239+ 'fade-in-0 slide-in-from-left-2 animate-in'
240+ ) }
241+ disabled = { isLoading || isRateLimited }
242+ key = { question . text }
243+ onClick = { ( ) => {
244+ if ( ! ( isLoading || isRateLimited ) ) {
245+ sendMessage ( question . text ) ;
246+ scrollToBottom ( ) ;
247+ }
248+ } }
249+ size = "sm"
250+ style = { { animationDelay : `${ index * 100 } ms` } }
251+ variant = "outline"
252+ >
253+ < question . icon className = "mr-3 h-4 w-4 flex-shrink-0 text-primary/70" />
254+ < div className = "flex-1" >
255+ < div className = "font-medium" > { question . text } </ div >
256+ < div className = "text-muted-foreground text-xs capitalize" >
257+ { question . type } response
258+ </ div >
258259 </ div >
259- </ div >
260- </ Button >
261- ) ) }
260+ </ Button >
261+ ) ) }
262+ </ div >
262263 </ div >
263264 </ div >
264- ) }
265+ </ div >
266+ ) }
265267
266- { /* Messages */ }
267- { hasMessages && (
268- < div className = "space-y-6" >
269- { messages . map ( ( message ) => (
270- < div className = "mb-2" key = { message . id } >
271- < MessageBubble message = { message } />
272- </ div >
273- ) ) }
274- < div ref = { bottomRef } />
275- </ div >
276- ) }
277- </ div >
278- </ ScrollArea >
268+ { /* Messages */ }
269+ { hasMessages && (
270+ < div className = "space-y-3" >
271+ { messages . map ( ( message ) => (
272+ < MessageBubble key = { message . id } message = { message } />
273+ ) ) }
274+ < div ref = { bottomRef } />
275+ </ div >
276+ ) }
277+ </ div >
279278 </ div >
280279
281280 { /* Enhanced Input Area */ }
0 commit comments