-
Notifications
You must be signed in to change notification settings - Fork 554
Expand file tree
/
Copy pathChatInlineLayout.tsx
More file actions
47 lines (44 loc) · 1.21 KB
/
ChatInlineLayout.tsx
File metadata and controls
47 lines (44 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/** @jsx createElement */
import { cx } from '../../lib';
import type { Renderer } from '../../types';
import type { ChatLayoutOwnProps } from './types';
export function createChatInlineLayoutComponent({ createElement }: Renderer) {
return function ChatInlineLayout(userProps: ChatLayoutOwnProps) {
const {
headerElement,
messagesElement,
promptElement,
classNames = {},
open: _open,
maximized: _maximized,
toggleButtonElement: _toggleButtonElement,
// Chat state props (destructured to avoid spreading on div)
messages: _messages,
status: _status,
isClearing: _isClearing,
clearMessages: _clearMessages,
onClearTransitionEnd: _onClearTransitionEnd,
suggestions: _suggestions,
tools: _tools,
...rest
} = userProps;
return (
<div
{...rest}
className={cx('ais-Chat', 'ais-ChatInlineLayout', classNames.root)}
>
<div
className={cx(
'ais-Chat-container',
'ais-Chat-container--open',
classNames.container
)}
>
{headerElement}
{messagesElement}
{promptElement}
</div>
</div>
);
};
}