import { CSSProperties, useEffect, useState } from 'react'; import { usePlaygroundTools, useClientContext, LineType } from '@flowgram.ai/free-layout-editor'; export const Tools = () => { const { history } = useClientContext(); const tools = usePlaygroundTools(); const [canUndo, setCanUndo] = useState(false); const [canRedo, setCanRedo] = useState(false); const buttonStyle: CSSProperties = { border: '1px solid #e0e0e0', borderRadius: '4px', cursor: 'pointer', padding: '4px', color: '#141414', background: '#e1e3e4', }; useEffect(() => { const disposable = history.undoRedoService.onChange(() => { setCanUndo(history.canUndo()); setCanRedo(history.canRedo()); }); return () => disposable.dispose(); }, [history]); return (