@@ -12,6 +12,7 @@ import { Logo } from "@/components/ui/logo";
1212import { useSearchParams } from "next/navigation" ;
1313import { WelcomeDialog } from "../welcome-dialog" ;
1414import { Anvil } from "lucide-react" ;
15+ import { cn } from "@/lib/utils" ;
1516
1617export const ChatContent = ( {
1718 id,
@@ -40,7 +41,7 @@ export const ChatContent = ({
4041 return (
4142 < >
4243 < div className = "bg-background relative flex h-full min-w-0 flex-col" >
43- { /* Messages - always shown */ }
44+ { /* Messages - flex-1 to take available space */ }
4445 < Messages
4546 chatId = { id }
4647 isReadonly = { isReadonly }
@@ -51,7 +52,7 @@ export const ChatContent = ({
5152 scrollToBottom = { scrollToBottom }
5253 />
5354
54- { /* Input Container - absolutely positioned, contains greeting, input, and starter prompts */ }
55+ { /* Input Container - normal flow no absolute positioning */ }
5556 < motion . div
5657 initial = { hasInitialMessages ? { y : 0 } : { y : "calc(-50vh + 50%)" } }
5758 animate = {
@@ -64,7 +65,14 @@ export const ChatContent = ({
6465 ease : "easeInOut" ,
6566 duration : 0.4 ,
6667 } }
67- className = "absolute bottom-4 left-1/2 h-fit w-full max-w-3xl -translate-x-1/2 px-4"
68+ className = { cn (
69+ "w-full px-4 pb-4" ,
70+
71+ ! hasMessages &&
72+ ! hasInitialMessages &&
73+ "absolute bottom-4 left-1/2 max-w-3xl -translate-x-1/2" ,
74+ ( hasMessages || hasInitialMessages ) && "mx-auto max-w-3xl" ,
75+ ) }
6876 >
6977 { /* Greeting - only shown when no messages */ }
7078 < AnimatePresence >
0 commit comments