import { DRAWING_CONFIGS } from "@excalidraw/element"; import { useState, useEffect } from "react"; export const FreedrawDebugSliders = () => { const [streamline, setStreamline] = useState( DRAWING_CONFIGS.default.streamline, ); const [simplify, setSimplify] = useState( DRAWING_CONFIGS.default.simplify, ); useEffect(() => { if (!window.h) { window.h = {} as any; } if (!window.h.debugFreedraw) { window.h.debugFreedraw = DRAWING_CONFIGS.default; } setStreamline(window.h.debugFreedraw.streamline); setSimplify(window.h.debugFreedraw.simplify); }, []); const handleStreamlineChange = (value: number) => { setStreamline(value); if (window.h && window.h.debugFreedraw) { window.h.debugFreedraw.streamline = value; } }; const handleSimplifyChange = (value: number) => { setSimplify(value); if (window.h && window.h.debugFreedraw) { window.h.debugFreedraw.simplify = value; } }; return (
); };