import React, { useCallback } from 'react';
import PropTypes from 'prop-types';
import { CellType } from '../../_basic';
import CheckboxEditor from './checkbox-editor';
import TextEditor from './text-editor';
import NumberEditor from './number-editor';
import SingleSelectEditor from './single-select-editor';
import MultipleSelectEditor from './multiple-select-editor';
import CollaboratorEditor from './collaborator-editor';
import DateEditor from './date-editor';
import { lang } from '../../../../utils/constants';
import './index.css';
const DetailEditor = ({ field, onChange: onChangeAPI, ...props }) => {
const onChange = useCallback((newValue) => {
onChangeAPI(field.key, newValue);
}, [field, onChangeAPI]);
switch (field.type) {
case CellType.CHECKBOX: {
return ();
}
case CellType.TEXT: {
return ();
}
case CellType.NUMBER: {
return ();
}
case CellType.DATE: {
return ();
}
case CellType.SINGLE_SELECT: {
return ();
}
case CellType.MULTIPLE_SELECT: {
return ();
}
case CellType.COLLABORATOR: {
return ();
}
default: {
return null;
}
}
};
DetailEditor.propTypes = {
field: PropTypes.object.isRequired,
};
export default DetailEditor;