import { jsx as _jsx } from "react/jsx-runtime";
import { useCallback, useMemo } from "react";
import { cn } from "../../utils/css";
export const ActionItem = (props)=>{
    const { action } = props;
    const onItemClick = useCallback(()=>{
        if (typeof action.onClick === "function") {
            action.onClick(action);
        } else {
            props.onClick?.({
                ...action,
                index: props.index
            });
        }
    }, [
        action
    ]);
    const child = useMemo(()=>{
        return action.label;
    }, [
        action.label
    ]);
    return /*#__PURE__*/ _jsx("div", {
        className: 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