import React from 'react'; import Button from '../components/Button'; import Icon from '../components/Icon'; import ExpansionPanel from '../components/ExpansionPanel'; import useActions from '../actions'; import useStore from '../store'; import { BtnWrapper } from '../global/toolStyled'; const CreateForm: React.FunctionComponent = () => { const [{ sidebarState }, dispatch] = useStore(); const { setSidebar } = useActions(dispatch); const onClickSidebar = (state: string): void => { if (state === sidebarState) { setSidebar(''); } else { setSidebar(state); } }; return ( { onClickSidebar('create-form'); }}> Create Form )} isActive={sidebarState === 'create-form'} > ); }; export default CreateForm;