aboutsummaryrefslogtreecommitdiff
path: root/src/pages/Support.tsx
diff options
context:
space:
mode:
authorMax Nanis2025-05-28 04:41:37 +0100
committerMax Nanis2025-05-28 04:41:37 +0100
commit8caa77413ea372e5cbd2980a9922d701af359c04 (patch)
tree9341e2f70fab6b2678fdff53c002954ef69c7b3e /src/pages/Support.tsx
downloadpanel-ui-8caa77413ea372e5cbd2980a9922d701af359c04.tar.gz
panel-ui-8caa77413ea372e5cbd2980a9922d701af359c04.zip
initial commit
Diffstat (limited to 'src/pages/Support.tsx')
-rw-r--r--src/pages/Support.tsx38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/pages/Support.tsx b/src/pages/Support.tsx
new file mode 100644
index 0000000..4746b77
--- /dev/null
+++ b/src/pages/Support.tsx
@@ -0,0 +1,38 @@
+import React, { useEffect } from 'react';
+
+const ChatwootLoader = () => {
+ useEffect(() => {
+ const loadChatwoot = () => {
+ const BASE_URL = "https://chat.g-r-l.com";
+ const script = document.createElement('script');
+ script.src = `${BASE_URL}/packs/js/sdk.js`;
+ script.defer = true;
+ script.async = true;
+
+ script.onload = () => {
+ if (window.chatwootSDK) {
+ window.chatwootSDK.run({
+ websiteToken: 'dEEw3fcexQvnQ5tesJPKFjSb',
+ baseUrl: BASE_URL,
+ });
+ }
+ };
+
+ document.body.appendChild(script);
+ };
+
+ loadChatwoot();
+
+ // Clean up script when the component unmounts
+ return () => {
+ const existingScript = document.querySelector(`script[src="https://app.chatwoot.com/packs/js/sdk.js"]`);
+ if (existingScript) {
+ document.body.removeChild(existingScript);
+ }
+ };
+ }, []);
+
+ return null;
+};
+
+export {ChatwootLoader}; \ No newline at end of file