37 lines
1.2 KiB
JavaScript
37 lines
1.2 KiB
JavaScript
import CopilotChatView_default from "./CopilotChatView.mjs";
|
|
import { CopilotChat } from "./CopilotChat.mjs";
|
|
import { CopilotSidebarView } from "./CopilotSidebarView.mjs";
|
|
import React, { useMemo } from "react";
|
|
import { jsx } from "react/jsx-runtime";
|
|
|
|
//#region src/components/chat/CopilotSidebar.tsx
|
|
function CopilotSidebar({ header, toggleButton, defaultOpen, width, ...chatProps }) {
|
|
const SidebarViewOverride = useMemo(() => {
|
|
const Component = (viewProps) => {
|
|
const { header: viewHeader, toggleButton: viewToggleButton, width: viewWidth, defaultOpen: viewDefaultOpen, ...restProps } = viewProps;
|
|
return /* @__PURE__ */ jsx(CopilotSidebarView, {
|
|
...restProps,
|
|
header: header ?? viewHeader,
|
|
toggleButton: toggleButton ?? viewToggleButton,
|
|
width: width ?? viewWidth,
|
|
defaultOpen: defaultOpen ?? viewDefaultOpen
|
|
});
|
|
};
|
|
return Object.assign(Component, CopilotChatView_default);
|
|
}, [
|
|
header,
|
|
toggleButton,
|
|
width,
|
|
defaultOpen
|
|
]);
|
|
return /* @__PURE__ */ jsx(CopilotChat, {
|
|
welcomeScreen: CopilotSidebarView.WelcomeScreen,
|
|
...chatProps,
|
|
chatView: SidebarViewOverride
|
|
});
|
|
}
|
|
CopilotSidebar.displayName = "CopilotSidebar";
|
|
|
|
//#endregion
|
|
export { CopilotSidebar as default };
|
|
//# sourceMappingURL=CopilotSidebar.mjs.map
|