import React from 'react';
import Types from '../../lib/Types';
import Module from '../../lib/Module';
import { View, Image } from 'react-native';
let image = require('./assets/default.jpg')

export default class ImageComp extends Module {
	constructor(props) {
		super(props);

	}

	display() {
		let {
			width,
			height,
			resizeMode,
			source
		} = this.props;
		if(!width) width = 100;
		if(!height) height = 100;
		if(!resizeMode) resizeMode = 'cover';
		return 	<Image
			          style={{width, height}}
			          resizeMode={resizeMode}
			          source={source || image}
			        />
	}
}


ImageComp.Inputs = {
	source: new Types.Text(),
	width: new Types.Integer().require().default(100),
	height: new Types.Integer().require().default(100),
	resizeMode: new Types.Text().require().default('cover')
}