import React from 'react';
import { FormattedMessage } from 'react-intl';
import MenuButton from 'components/common/MenuButton';
import Gear from 'assets/gear.svg';
import useStore, { setDashboard } from 'store/app';
import Button from 'components/common/Button';
import Check from 'assets/check.svg';
import styles from './DashboardSettingsButton.module.css';
const selector = state => state.dashboard;
export default function DashboardSettingsButton() {
const settings = useStore(selector);
const menuOptions = [
{
label: ,
value: 'charts',
},
{
label: ,
value: 'order',
},
];
function handleSelect(value) {
if (value === 'charts') {
setDashboard({ ...settings, showCharts: !settings.showCharts });
}
if (value === 'order') {
setDashboard({ ...settings, changeOrderMode: !settings.changeOrderMode });
}
//setDashboard(value);
}
function handleExitChangeOrderMode() {
setDashboard({ ...settings, changeOrderMode: !settings.changeOrderMode });
}
function resetWebsiteOrder() {
setDashboard({ ...settings, websiteOrdering: {} });
}
if (settings.changeOrderMode)
return (
}>
);
return } options={menuOptions} onSelect={handleSelect} hideLabel />;
}