import React from 'react'; import ToolbarComponent from '../components/Toolbar'; import useActions from '../actions'; import useStore from '../store'; import { scrollIntoView } from '../helpers/utility'; const Toolbar: React.FC = () => { const [ { totalPage, currentPage, scale, rotation, viewport, displayMode }, dispatch, ] = useStore(); const { setCurrentPage: setCurrentPageAction, changeScale, changeRotate, toggleDisplayMode, setMarkupTool, } = useActions(dispatch); const setCurrentPage = (num: number): void => { if (num > 0) { const ele: HTMLElement = document.getElementById( `page_${num}` ) as HTMLElement; scrollIntoView(ele); } setCurrentPageAction(num); }; const handleHandClick = (): void => { setMarkupTool(''); }; return ( ); }; export default Toolbar;