-
Notifications
You must be signed in to change notification settings - Fork 479
Expand file tree
/
Copy pathContainer.tsx
More file actions
45 lines (43 loc) · 1.05 KB
/
Container.tsx
File metadata and controls
45 lines (43 loc) · 1.05 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
import clsx from "clsx";
import { LayoutContextProvider } from "../../context/LayoutContext";
import { ShellStoreProvider } from "../_shared/store";
interface ContainerProps {
children?: React.ReactNode;
logoUrl: string;
agentName: string;
className?: string;
showAssistantLogo?: boolean;
/** Control the open state of the tray */
isOpen?: boolean;
}
export const Container = ({
children,
logoUrl,
agentName,
className,
showAssistantLogo = false,
isOpen = false,
}: ContainerProps) => {
return (
<ShellStoreProvider
logoUrl={logoUrl}
agentName={agentName}
showAssistantLogo={showAssistantLogo}
>
<LayoutContextProvider layout="tray">
<div
className={clsx(
"openui-bottom-tray-container",
{
"openui-bottom-tray-container--open": isOpen,
"openui-bottom-tray-container--closed": !isOpen,
},
className,
)}
>
{children}
</div>
</LayoutContextProvider>
</ShellStoreProvider>
);
};