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