import React, { useEffect } from 'react';
import { useTranslation } from 'react-i18next';
import Button from '../components/Button';
import ExpansionPanel from '../components/ExpansionPanel';
import Icon from '../components/Icon';
import HighlightTools from './HighlightTools';
import FreehandTools from './FreehandTools';
import TextTools from './FreeTextTools';
import StickyNoteTools from './StickyNoteTools';
import ShapeTools from './ShapeTools';
import useActions from '../actions';
import useStore from '../store';
const MarkupTools: React.FC = () => {
const { t } = useTranslation('sidebar');
const [{ sidebarState, markupToolState }, dispatch] = useStore();
const { setSidebar, setMarkupTool } = useActions(dispatch);
const onClickSidebar = (state: string): void => {
if (state === sidebarState) {
setSidebar('');
} else {
setSidebar(state);
}
};
const onClickTool = (state: string): void => {
if (state === markupToolState) {
setMarkupTool('');
} else {
setMarkupTool(state);
}
};
useEffect(() => {
if (sidebarState !== 'markup-tools') {
setMarkupTool('');
}
}, []);
const Label = (
);
return (
{
onClickTool('highlight');
}}
/>
{
onClickTool('freehand');
}}
/>
{
onClickTool('text');
}}
/>
{
onClickTool('sticky');
}}
/>
{
onClickTool('shape');
}}
/>
);
};
export default MarkupTools;