11import React from "react" ;
2- import { Chatbot , type ChatbotProps } from "./Chatbot " ;
2+ import { DocsChatbot , type DocsChatbotProps } from "./DocsChatbot " ;
33import createShadowRoot from "./createShadowRoot" ;
44import cssText from "../src/index.css?inline" ;
55import { ShadowRootProvider } from "@/providers/ShadowRootProvider" ;
66
7- type SqliteAiChatbotConfig = {
7+ type DocsChatbotConfig = {
88 containerId : string ;
9- } & ChatbotProps ;
9+ } & DocsChatbotProps ;
1010
11- class SqliteAiChatbotWidget {
12- init ( config : SqliteAiChatbotConfig ) : void {
11+ class DocsChatbotWidget {
12+ init ( config : DocsChatbotConfig ) : void {
1313 const { containerId, ...chatbotProps } = config ;
1414
1515 const container = document . getElementById ( containerId ) ;
@@ -32,7 +32,7 @@ class SqliteAiChatbotWidget {
3232 React . createElement (
3333 ShadowRootProvider ,
3434 { value : portalContainer } ,
35- React . createElement ( Chatbot , chatbotProps )
35+ React . createElement ( DocsChatbot , chatbotProps )
3636 )
3737 ) ;
3838 } catch ( error ) {
@@ -41,20 +41,20 @@ class SqliteAiChatbotWidget {
4141 }
4242}
4343
44- const chatbotWidget = new SqliteAiChatbotWidget ( ) ;
44+ const chatbotWidget = new DocsChatbotWidget ( ) ;
4545
4646declare global {
4747 interface Window {
48- SqliteAiChatbot : SqliteAiChatbotWidget ;
48+ DocsChatbot : DocsChatbotWidget ;
4949 }
50- var SqliteAiChatbot : SqliteAiChatbotWidget | undefined ;
50+ var DocsChatbot : DocsChatbotWidget | undefined ;
5151}
5252
5353if ( typeof window !== "undefined" ) {
54- window . SqliteAiChatbot = chatbotWidget ;
54+ window . DocsChatbot = chatbotWidget ;
5555}
5656if ( typeof globalThis !== "undefined" ) {
57- globalThis . SqliteAiChatbot = chatbotWidget ;
57+ globalThis . DocsChatbot = chatbotWidget ;
5858}
5959
6060export default chatbotWidget ;
0 commit comments