@@ -31,7 +31,7 @@ interface ExtraContentFields {
31
31
32
32
type ContentWithUser = Content & ExtraContentFields ;
33
33
34
- export default function Page ( { agentId } : { agentId : UUID } ) {
34
+ export default function Page ( { agentId, className } : { agentId : UUID , className ?: string } ) {
35
35
const { toast } = useToast ( ) ;
36
36
const [ selectedFile , setSelectedFile ] = useState < File | null > ( null ) ;
37
37
const [ input , setInput ] = useState ( "" ) ;
@@ -72,7 +72,7 @@ export default function Page({ agentId }: { agentId: UUID }) {
72
72
const attachments : IAttachment [ ] | undefined = selectedFile
73
73
? [
74
74
{
75
- url : URL . createObjectURL ( selectedFile ) ,
75
+ url : selectedFile ? URL . createObjectURL ( selectedFile ) : '' ,
76
76
contentType : selectedFile . type ,
77
77
title : selectedFile . name ,
78
78
} ,
@@ -165,13 +165,15 @@ export default function Page({ agentId }: { agentId: UUID }) {
165
165
} ) ;
166
166
167
167
return (
168
- < div className = "flex flex-col w-full h-[calc(100dvh)] p-4" >
169
- < div className = "flex-1 overflow-y-auto" >
170
- < ChatMessageList ref = { messagesContainerRef } >
168
+ < div
169
+ className = { cn ( "flex flex-col w-full h-full relative" , className ) }
170
+ >
171
+ < div className = "absolute inset-0 overflow-y-auto px-4 pt-4 pb-[180px]" >
172
+ < ChatMessageList ref = { messagesContainerRef } className = "h-full" >
171
173
{ transitions ( ( styles , message ) => {
172
174
const variant = getMessageVariant ( message ?. user ) ;
173
175
return (
174
- // @ts -expect-error
176
+ // @ts -expect-error animated.div from react-spring has incompatible types with ChatBubble props
175
177
< animated . div
176
178
style = { styles }
177
179
className = "flex flex-col gap-2 p-4"
@@ -268,7 +270,7 @@ export default function Page({ agentId }: { agentId: UUID }) {
268
270
} ) }
269
271
</ ChatMessageList >
270
272
</ div >
271
- < div className = "px-4 pb-4" >
273
+ < div className = "fixed bottom-0 left-0 right-0 px-4 pb-4 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/50 " >
272
274
< form
273
275
ref = { formRef }
274
276
onSubmit = { handleSendMessage }
@@ -286,7 +288,7 @@ export default function Page({ agentId }: { agentId: UUID }) {
286
288
< X />
287
289
</ Button >
288
290
< img
289
- src = { URL . createObjectURL ( selectedFile ) }
291
+ src = { selectedFile ? URL . createObjectURL ( selectedFile ) : '' }
290
292
height = "100%"
291
293
width = "100%"
292
294
className = "aspect-square object-contain w-16"
@@ -353,4 +355,4 @@ export default function Page({ agentId }: { agentId: UUID }) {
353
355
</ div >
354
356
</ div >
355
357
) ;
356
- }
358
+ }
0 commit comments