This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useCallback } from "react"; | |
import { ReactSortable } from "react-sortablejs"; | |
export interface TreeItem { | |
id: string; | |
component: React.ReactElement; | |
// chosen: boolean; | |
children?: TreeItem[]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const ChatwootWidget: React.FC<ChatwootWidgetProps> = () => { | |
useEffect(() => { | |
// Define a function to load the Chatwoot script | |
const loadChatwootScript = () => { | |
const BASE_URL = {TOUR CHATWOOT SELF HOSTED URL); | |
const WEBSITE_TOKEN = {YOUR WEBSITE TOKEN} | |
const script = document.createElement('script'); | |
script.src = `${BASE_URL}/packs/js/sdk.js`; | |
script.async = true; |