import { useCallback } from 'react'; import { usePlayground } from '@flowgram.ai/free-layout-editor'; import { IconButton, Tooltip } from '@douyinfe/semi-ui'; import { IconUnlock, IconLock } from '@douyinfe/semi-icons'; export const Readonly = () => { const playground = usePlayground(); const toggleReadonly = useCallback(() => { playground.config.readonly = !playground.config.readonly; }, [playground]); return playground.config.readonly ? ( } onClick={toggleReadonly} /> ) : ( } onClick={toggleReadonly} /> ); };