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.ArrayEditor;
		case Types.Text:
			if(Type.isColor) 
				return Editors.ColorEditor;
			return Editors.TextEditor;
		case Types.Number: 
		case Types.Integer:
			return Editors.Numbers;
		case Types.Boolean:
			return Editors.BoolEditor;
		case Types.Action:
			return Editors.ActionEditor;
		case Types.Module:
			return Editors.ModuleEditor;
		default: 
			return Editors.TextEditor;
	}
}