import Library from 'trapilib/dist/lib';

import Editors from './index.js';

let Types = Library.DataTypes.Types;
export default function(Type) {
	switch(Type.type) {
		case Types.Array:
			return Editors.FormEditor;
		case Types.Text:
			if(Type.isColor) 
				return Editors.ColorEditor;
			return Editors.TextEditor;
		case Types.Number: 
		case Types.Bool:
		case Types.Integer:
			return Editors.Numbers;
		default: 
			return Editors.TextEditor;
	}
}