import React, { ReactElement, useCallback } from 'react'; import { RenderItem } from './RenderItem'; import { SupportedCardGalleryItemProps } from './SupportedCardGalleryItemProps'; import { GridBaseState } from '../../state'; import { FiltersMap } from '@wix/bex-core'; import { AddItemProps } from '@wix/design-system'; import { ActionCell } from '../ActionCell'; import { GridItem } from './GridItem'; import { GridDragAndDrop } from '../GridDragAndDropDndKit/GridDragAndDrop'; import type { Preset } from './Grid.types'; export interface UseRenderItemParams { preset?: Preset; renderItem?: ( item: T, index: number, ) => Partial; state: GridBaseState; renderAddItem?: () => ReactElement; actionCell?: ActionCell; dragAndDrop?: typeof GridDragAndDrop; } export function useRenderItem( params: UseRenderItemParams, ) { const { renderItem, state, renderAddItem, dragAndDrop, actionCell, preset = 'title', } = params; return useCallback( (index, { itemKey: _itemKey, index2d } = {}) => ( ), [renderItem, actionCell, renderAddItem, dragAndDrop, preset], ); }