import React from 'react';
import { observer } from 'mobx-react-lite';
import { Box, Button } from '@wix/design-system';
import { useCardActions } from './useCardActions';
import { MessageActionModal } from '../ActionModal';
import { DisabledTooltip } from '../DisabledTooltip';
function _CardActions({ actionCell, originalItem, itemIndex, itemActionsState, stageKey, item, state, }) {
    const { secondaryActions, primaryActionProps: _primaryActionProps } = useCardActions({
        actionCell,
        originalItem,
        itemIndex,
        itemActionsState,
        stageKey,
        cardKey: item.key,
        state,
    });
    const primaryActionProps = _primaryActionProps;
    return (React.createElement(React.Fragment, null,
        itemActionsState.confirmModal.value && (React.createElement(MessageActionModal, { state: itemActionsState.confirmModal, ...itemActionsState.confirmModal.value })),
        React.createElement(Box, { gap: "9px" },
            secondaryActions,
            primaryActionProps && (React.createElement(DisabledTooltip, { content: primaryActionProps.disabledMessage, disabled: !primaryActionProps.disabled, dataHook: `kanban-card-primary-action-tooltip-${stageKey}-${item.key}` },
                React.createElement(Button, { style: { zIndex: 50 }, size: "tiny", priority: "secondary", onClick: (e) => {
                        e.stopPropagation();
                        primaryActionProps.onClick();
                    }, disabled: primaryActionProps.disabled, prefixIcon: primaryActionProps.prefixIcon, dataHook: `kanban-card-primary-action-${stageKey}-${item.key}` }, primaryActionProps.text))))));
}
export const CardActions = observer(_CardActions);
//# sourceMappingURL=CardActions.js.map