import { GenericCellEditorProps, GridCell } from '../GridCell';
import { GridFormInlineTextInput } from '../gridForm/GridFormInlineTextInput';
import { GenericCellColDef } from '../gridRender/GridRenderGenericCell';
import { ColDefT, GridBaseRow } from '../types';

export const GridInlineTextInput = <TData extends GridBaseRow, TValue = any>(
  colDef: GenericCellColDef<TData, TValue>,
  params: GenericCellEditorProps<GridFormInlineTextInput<TData>>,
): ColDefT<TData, TValue> =>
  GridCell<TData, TValue, GridFormInlineTextInput<TData>>(colDef, {
    editor: GridFormInlineTextInput,
    ...params,
  });
