import React from 'react';
import { CellDocumentEdit } from '@wix/patterns-fields';
import type { CellEditProps } from '../../types';

export const DocumentEdit: React.FC<CellEditProps<string | null>> = ({
  value,
  onChange,
  onCommit,
  onCancel,
  onStartEdit,
  inputRef,
  columnId,
  rowKey,
}) => (
  <CellDocumentEdit
    value={value}
    onChange={onChange}
    onCommit={onCommit}
    onCancel={onCancel}
    onStartEdit={onStartEdit}
    inputRef={inputRef}
    dataHook="document-edit"
    fieldId={`document-edit-${columnId}-${rowKey}`}
  />
);
