"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.useLogic = void 0;
const react_1 = require("react");
const useLogic = ({ row, actions, mainActions, secondaryActions, }) => {
    const handleActionClick = (0, react_1.useCallback)((onClick) => () => {
        onClick?.(row);
    }, [row]);
    const handleWrapperClick = (event) => {
        event.stopPropagation();
    };
    const hasSecondaryActions = secondaryActions || actions?.secondary !== undefined;
    const hasMainActions = Boolean(mainActions || actions?.main?.length);
    return {
        handleActionClick,
        handleWrapperClick,
        actions,
        mainActions,
        secondaryActions,
        hasSecondaryActions,
        hasMainActions,
    };
};
exports.useLogic = useLogic;
