InvokeAI/frontend/src/features/tabs/ShowHideOptionsPanelButton.tsx
2022-10-31 23:56:49 +11:00

27 lines
738 B
TypeScript

import { IoMdOptions } from 'react-icons/io';
import { useAppDispatch } from '../../app/store';
import IAIIconButton from '../../common/components/IAIIconButton';
import { setShouldShowOptionsPanel } from '../options/optionsSlice';
const ShowHideOptionsPanelButton = () => {
const dispatch = useAppDispatch();
const handleShowOptionsPanel = () => {
dispatch(setShouldShowOptionsPanel(true));
};
return (
<IAIIconButton
tooltip="Show Options Panel (G)"
tooltipPlacement="top"
aria-label="Show Options Panel"
styleClass="floating-show-hide-button left"
onMouseOver={handleShowOptionsPanel}
>
<IoMdOptions />
</IAIIconButton>
);
};
export default ShowHideOptionsPanelButton;