@@ -4,30 +4,31 @@ import { Button, Icon, Input } from '@/components'
4
4
import ChatAvatarIcon from '@/icons/chat-avatar.svg'
5
5
import { cn } from '@utils/cn'
6
6
7
- const Root : FC = ( { children } : PropsWithChildren < HTMLAttributes < HTMLElement > > ) => {
7
+ const Root : FC < PropsWithChildren < HTMLAttributes < HTMLElement > > > = ( { children } ) => {
8
+ return < div className = "flex size-full max-w-[460px] flex-col bg-background-1" > { children } </ div >
9
+ }
10
+
11
+ const Header : FC < { onClose : ( ) => void } > = ( { onClose } ) => {
8
12
return (
9
- < div className = "flex size-full max-w-[460px] flex-col bg-background-1" >
10
- < div className = "sticky top-0 flex items-center justify-between bg-background-1 px-6 py-4" >
11
- < p className = "text-16 font-medium text-foreground-1" > AI Assistant</ p >
12
- < Button size = "icon" variant = "custom" className = "-mr-2 text-icons-4 hover:text-icons-2" >
13
- < Icon name = "close" size = { 16 } />
14
- < span className = "sr-only" > Close</ span >
15
- </ Button >
16
- </ div >
17
- { children }
13
+ < div className = "sticky top-0 flex items-center justify-between bg-background-1 px-6 py-4" >
14
+ < p className = "text-16 font-medium text-foreground-1" > AI Assistant</ p >
15
+ < Button size = "icon" variant = "custom" className = "-mr-2 text-icons-4 hover:text-icons-2" onClick = { onClose } >
16
+ < Icon name = "close" size = { 16 } />
17
+ < span className = "sr-only" > Close</ span >
18
+ </ Button >
18
19
</ div >
19
20
)
20
21
}
21
22
22
- const Body : FC = ( { children } : PropsWithChildren < HTMLAttributes < HTMLElement > > ) => {
23
+ const Body : FC < PropsWithChildren < HTMLAttributes < HTMLElement > > > = ( { children } ) => {
23
24
return (
24
25
< div className = "scrollbar-hidden flex flex-1 flex-col gap-y-7 overflow-y-auto overflow-x-hidden px-6 py-2" >
25
26
{ children }
26
27
</ div >
27
28
)
28
29
}
29
30
30
- const Footer : FC = ( { children } : PropsWithChildren < HTMLAttributes < HTMLElement > > ) => {
31
+ const Footer : FC < PropsWithChildren < HTMLAttributes < HTMLElement > > > = ( { children } ) => {
31
32
return < div className = "sticky bottom-0 bg-background-1 px-6 py-3" > { children } </ div >
32
33
}
33
34
@@ -64,7 +65,7 @@ const Message: FC<MessageProps> = ({ self, avatar, actions, children }) => {
64
65
)
65
66
}
66
67
67
- const CodeBlock : FC < { className ?: string } > = ( { children, className } ) => {
68
+ const CodeBlock : FC < PropsWithChildren < { className ?: string } > > = ( { children, className } ) => {
68
69
return (
69
70
< code
70
71
className = { cn (
@@ -194,6 +195,7 @@ const InputField: FC<InputFieldProps> = ({
194
195
export const Chat = {
195
196
Root,
196
197
Body,
198
+ Header,
197
199
Footer,
198
200
Message,
199
201
Typing,
0 commit comments