import { useEffect } from 'react';
import type { FiltersMap } from '@wix/bex-core';
import type { EditableTableProps } from './EditableTable';

export function useEditableTableCollectionSyncProps<T, F extends FiltersMap>(
  props: EditableTableProps<T, F>,
) {
  const { state, columns } = props;

  useEffect(() => state.init(columns), [state, columns]);
}
