"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
Object.defineProperty(exports, "ActionItem", {
    enumerable: true,
    get: function() {
        return ActionItem;
    }
});
const _jsxruntime = require("react/jsx-runtime");
const _react = require("react");
const _css = require("../../utils/css");
const ActionItem = (props)=>{
    const { action } = props;
    const onItemClick = (0, _react.useCallback)(()=>{
        if (typeof action.onClick === "function") {
            action.onClick(action);
        } else {
            props.onClick?.({
                ...action,
                index: props.index
            });
        }
    }, [
        action
    ]);
    const child = (0, _react.useMemo)(()=>{
        return action.label;
    }, [
        action.label
    ]);
    return /*#__PURE__*/ (0, _jsxruntime.jsx)("div", {
        className: (0, _css.cn)("orderly-flex orderly-justify-center orderly-items-center orderly-text-lg orderly-h-[52px] orderly-cursor-pointer", {
            "orderly-text-primary": props.active
        }),
        onClick: onItemClick,
        children: child
    });
};

//# sourceMappingURL=actionItem.js.map