From 1d3580445259d54702511a9a505f82212a705a5d Mon Sep 17 00:00:00 2001 From: "vault-token-factory-spectrocloud[bot]" <133815545+vault-token-factory-spectrocloud[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 18:57:17 +0000 Subject: [PATCH] Disable Mendable model (#2449) (#2455) * chore: disable mendable model * chore: comment out import lines (cherry picked from commit 6a831e9745ba40835f11b73fbc98cb1579ee2cc3) Co-authored-by: caroldelwing --- .../MendableAIWidget/MendableAIWidget.tsx | 88 +++++++++---------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/src/components/MendableAIWidget/MendableAIWidget.tsx b/src/components/MendableAIWidget/MendableAIWidget.tsx index 68a1fd3d09..7841ea0ff9 100644 --- a/src/components/MendableAIWidget/MendableAIWidget.tsx +++ b/src/components/MendableAIWidget/MendableAIWidget.tsx @@ -1,50 +1,50 @@ -import { useEffect } from "react"; -import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; -import useBaseUrl from "@docusaurus/useBaseUrl"; +// import { useEffect } from "react"; +// import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; +// import useBaseUrl from "@docusaurus/useBaseUrl"; -export const MENDABLE_SCRIPT_URL = "https://unpkg.com/@mendable/search@0.0.205/dist/umd/mendable-bundle.min.js"; +// export const MENDABLE_SCRIPT_URL = "https://unpkg.com/@mendable/search@0.0.205/dist/umd/mendable-bundle.min.js"; export default function MendableAIWidget() { - const { - siteConfig: { customFields }, - } = useDocusaurusContext(); - - const logoUrl = useBaseUrl("/spectrocloud-logo.png"); - const botUrl = useBaseUrl("/spectrocloud-logo-black.svg"); - - useEffect(() => { - const script = document.createElement("script"); - script.src = MENDABLE_SCRIPT_URL; - script.defer = true; - - setTimeout(() => { - document.body.appendChild(script); - }, 500); - - script.onload = () => { - if (window.Mendable) { - window.Mendable.initialize({ - anon_key: customFields?.mendableKey, - type: "floatingButton", - dialogPlaceholder: "What is Palette?", - welcomeMessage: "Ask me anything about Palette", - cmdShortcutKey: "l", - icon: logoUrl, - botIcon: botUrl, - isPinnable: true, - floatingButtonStyle: { - color: "#FFFFFF", - backgroundColor: "#3E4FB5", - }, - style: { accentColor: "#3E4FB5" }, - }); - } - }; - - return () => { - document.body.removeChild(script); - }; - }, []); + // const { + // siteConfig: { customFields }, + // } = useDocusaurusContext(); + + // const logoUrl = useBaseUrl("/spectrocloud-logo.png"); + // const botUrl = useBaseUrl("/spectrocloud-logo-black.svg"); + + // useEffect(() => { + // const script = document.createElement("script"); + // script.src = MENDABLE_SCRIPT_URL; + // script.defer = true; + + // setTimeout(() => { + // document.body.appendChild(script); + // }, 500); + + // script.onload = () => { + // if (window.Mendable) { + // window.Mendable.initialize({ + // anon_key: customFields?.mendableKey, + // type: "floatingButton", + // dialogPlaceholder: "What is Palette?", + // welcomeMessage: "Ask me anything about Palette", + // cmdShortcutKey: "l", + // icon: logoUrl, + // botIcon: botUrl, + // isPinnable: true, + // floatingButtonStyle: { + // color: "#FFFFFF", + // backgroundColor: "#3E4FB5", + // }, + // style: { accentColor: "#3E4FB5" }, + // }); + // } + // }; + + // return () => { + // document.body.removeChild(script); + // }; + // }, []); return null; }