"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MovePlusMinus = void 0;
const tslib_1 = require("tslib");
const React = tslib_1.__importStar(require("react"));
const SimpleButton_1 = tslib_1.__importDefault(require("../../components/SimpleButton"));
const PlusMinusRedux = tslib_1.__importStar(require("../../Redux/ActionsReducers/PlusMinusRedux"));
const react_redux_1 = require("react-redux");
const AdaptableContext_1 = require("../AdaptableContext");
const MovePlusMinus = (props) => {
    const dispatch = (0, react_redux_1.useDispatch)();
    const adaptable = (0, AdaptableContext_1.useAdaptable)();
    const plusMinusNudges = (0, react_redux_1.useSelector)((state) => state.PlusMinus.PlusMinusNudges);
    const handleMoveUp = React.useCallback(() => {
        dispatch(PlusMinusRedux.PlusMinusMoveUp(props.data));
    }, []);
    const handleMoveDown = React.useCallback(() => {
        dispatch(PlusMinusRedux.PlusMinusMoveDown(props.data));
    }, []);
    if (plusMinusNudges?.length <= 1) {
        return React.createElement(React.Fragment, null);
    }
    return (React.createElement(React.Fragment, null,
        React.createElement(SimpleButton_1.default, { "data-id": "move-up", title: "move up", onClick: handleMoveUp, variant: "text", icon: "arrow-up" }),
        React.createElement(SimpleButton_1.default, { "data-name": "move-down", title: "move down", onClick: handleMoveDown, variant: "text", icon: "arrow-down" })));
};
exports.MovePlusMinus = MovePlusMinus;
