import { NestedTableDataItem } from '../../state/NestedTableState/NestedTableNodeState'; import { FiltersMap } from '@wix/bex-core'; import React from 'react'; import { observer } from 'mobx-react-lite'; import { Table } from '@wix/design-system'; import { useDraggableRowContext } from '@wix/wix-style-react-incubator/drag-and-drop'; export interface NestedTableGhostIndentationCellProps< C extends string, T, F extends FiltersMap, > { item: NestedTableDataItem; } function _NestedTableGhostIndentationCell< C extends string, T, F extends FiltersMap, >(props: NestedTableGhostIndentationCellProps) { const { item } = props; const { state } = item; const { nestedTable } = state; const { isDragOverlay } = useDraggableRowContext(); const dragDepth = nestedTable.nestedTableDragAndDrop?.dragAndDropDisabled ? nestedTable.nestedTableDragAndDrop.dragEventItems?.activeItem.item.state .childrenDepth : nestedTable.nestedTableDragAndDrop?.dragEventDepth?.depth; const { tableDragAndDropState } = nestedTable.tableState; const activeId = tableDragAndDropState?.dnd.activeId; if (activeId !== item.originalKeyedItem?.id || isDragOverlay) { return null; } const { classes } = Table.dataTableRowStyle; return ( ); } export const NestedTableGhostIndentationCell = observer( _NestedTableGhostIndentationCell, );