@@ -7,7 +7,9 @@ import { Badge } from "@/components/ui/badge";
77import {
88 ChatCircleDotsIcon ,
99 MicrophoneIcon ,
10+ RobotIcon ,
1011 SpinnerGapIcon ,
12+ UserIcon ,
1113} from "@phosphor-icons/react" ;
1214import {
1315 Select ,
@@ -104,7 +106,7 @@ const UIInput = () => {
104106 msg . id === tempMessageId ? { ...msg , content } : msg ,
105107 ) ,
106108 ) ;
107- } , 50 ) ;
109+ } , 50 ) ;
108110 } ;
109111
110112 while ( true ) {
@@ -242,10 +244,10 @@ const UIInput = () => {
242244 const { selectedFont } = useFont ( ) ;
243245
244246 return (
245- < div className = "flex h-screen max-h-svh w-full" >
247+ < div className = "flex h-[96vh] w-full overflow-hidden " >
246248 < div className = "relative flex h-full w-full flex-col" >
247249 { showWelcome && messages . length === 0 ? (
248- < div className = "mt-20 flex w-full flex-col" >
250+ < div className = "flex h-full w-full flex-col" >
249251 < div className = "flex h-full w-full flex-col items-center justify-center" >
250252 < div className = "drop-shadow-primary/60 bg-primary relative mb-6 size-[4.5rem] overflow-hidden rounded-xl drop-shadow-2xl" >
251253 < div className = "bg-foreground absolute top-1/2 left-1/2 flex size-12 -translate-x-1/2 -translate-y-1/2 items-center justify-center rounded-full" >
@@ -263,21 +265,38 @@ const UIInput = () => {
263265 </ div >
264266 </ div >
265267 ) : (
266- < div className = "flex flex-1 flex-col gap-4 overflow-y-auto px-4 py-4 pb-40 md:px-8 lg:px-16 " >
267- < div className = "mx-auto w-full max-w-4xl" >
268+ < div className = "mt-6 flex h-full w-full flex-1 flex-col gap-4 overflow-y-auto px-4 py-4 md:px-8" >
269+ < div className = "mx-auto h-full w-full max-w-4xl" >
268270 { messages . map ( ( message ) => (
269271 < div
270272 key = { message . id }
271- className = { `mb-4 flex flex-col gap-2 rounded-lg p-4 ${
272- message . role === "user"
273- ? "bg-primary/10 w-full self-end md:w-5/6 lg:w-3/4"
274- : "bg-muted w-full self-start md:w-5/6 lg:w-3/4"
275- } `}
273+ className = { `mb-8 flex w-fit flex-col gap-2` }
276274 >
277275 < div className = "font-medium" >
278- { message . role === "user" ? "You" : "AI" }
276+ { message . role === "user" ? (
277+ < div className = "flex w-fit items-center gap-2 text-base font-semibold" >
278+ < div className = "bg-accent flex size-6 items-center justify-center rounded-md" >
279+ < UserIcon weight = "bold" />
280+ </ div >
281+ < div > You</ div >
282+ </ div >
283+ ) : (
284+ < div className = "flex w-fit items-center gap-2 text-base font-semibold" >
285+ < div className = "bg-accent flex size-6 items-center justify-center rounded-md" >
286+ < RobotIcon weight = "bold" />
287+ </ div >
288+ < div > AI</ div >
289+ </ div >
290+ ) }
279291 </ div >
280- < div className = "prose dark:prose-invert max-w-none" >
292+ < div
293+ className = { cn (
294+ "prose dark:prose-invert max-w-none rounded-lg border px-4 py-2" ,
295+ message . role === "user"
296+ ? "bg-primary w-fit max-w-full font-bold"
297+ : "bg-muted w-full" ,
298+ ) }
299+ >
281300 < ReactMarkdown
282301 remarkPlugins = { [ remarkGfm ] }
283302 components = { {
@@ -385,12 +404,12 @@ const UIInput = () => {
385404 </ div >
386405 </ div >
387406 ) }
388-
389- < div className = "bg-muted border-border/20 absolute bottom-0 w-full border-t p-2" >
407+
408+ < div className = "bg-muted border-border/20 w-full rounded-2xl border-t p-2" >
390409 < div className = "mx-auto w-full max-w-4xl" >
391410 < form
392411 onSubmit = { handleCreateChat }
393- className = "bg-accent/30 flex w-full flex-col rounded-xl p-3 pb-6 "
412+ className = "bg-accent/30 flex w-full flex-col rounded-xl p-3 pb-3 "
394413 >
395414 < Textarea
396415 value = { query }
0 commit comments