Skip to content

Instantly share code, notes, and snippets.

View lveillard's full-sized avatar

Loïc Veillard lveillard

View GitHub Profile
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;
@lveillard
lveillard / gist:a82ef7a64ce238d07e43e6a293d9cb72
Created February 1, 2023 14:48
Tree with sortablejs example
import { useCallback } from "react";
import { ReactSortable } from "react-sortablejs";
export interface TreeItem {
id: string;
component: React.ReactElement;
// chosen: boolean;
children?: TreeItem[];
}