/** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { useContext } from '@wordpress/element'; /** * Internal dependencies */ import { AdminContext } from '../../../index'; import { toNumber } from '../../../../lib/helper'; import SettingItem from '../../components/setting-item'; export default function StickyScrollMaxLineCount() { const { editorOptions, setEditorOptions } = useContext( AdminContext ); const onChange = ( value: number | undefined ) => { setEditorOptions( { ...editorOptions, stickyScroll: { ...editorOptions.stickyScroll, maxLineCount: value ? toNumber( value, 1, 20 ) : 5, }, } ); }; return ( ); }