import React, { forwardRef, ReactElement, JSXElementConstructor, useState, } from 'react'; import { FiltersMap, KeyedItem } from '@wix/bex-core'; import { TableSectionRow } from './TableSectionRow'; import { TableSectionsState } from './TableSectionsState'; import { useTableBaseRow } from '../Table/useTableBaseRow'; export const useTableSectionRow = ( state: TableSectionsState, ) => { const RegularTrElement = useTableBaseRow(state.table); const [CustomSectionsTR] = useState< React.ForwardRefExoticComponent<{ children: ReactElement>[]; rowData: KeyedItem; className: string; }> >( forwardRef((props, ref) => ( } state={state} RegularTrElement={RegularTrElement} /> )), ); return CustomSectionsTR; };