import React from 'react';
import LinkManager from 'modularity-front';
import Modularity from 'modularity-front';
import {Button ,Col,Row, Input} from 'react-materialize';
import Pagination from '../../Modules/Pagination';
import Card from '../../Modules/Card';
import Repository from '../../Services/Repository';
import FilterModule from '../../Modules/FilterModule';
import ProductPresent from '../../Modules/Product/Present';

import DoneIcon from '@material-ui/icons/Done';
import SearchBar from '../../Modules/searchbar';
import ChipModule from '../../Modules/Chip';

let Module = Modularity.Module;



class PrinterPresentPackage extends Modularity.Module {
	constructor(props) {
		super(props);
		this.state = {
			product: {}
		}
		this.repo = new Repository('printers');
		this.productId = this.RoutingSystem.getRoute().params.printerId;
		this.repo.get(this.productId)
		.then((product) => this.setState({product}))
		.catch((e) => alert("NOT FOUND"));
	}
	

	render() {
		return(
			<div className="PrinterPresentPackage">
				<div>
					<ProductPresent noBuy Product={this.state.product} addToCart={(q) => this.AddToCart.set({
						id: this.state.product.id,
						name: this.state.product.name,
						price: this.state.product.price,
						quantity: q
					}) }/>
				</div>
				{super.render()}
			</div>
		);
				    
	}
}


PrinterPresentPackage.EditPosition = "center";
PrinterPresentPackage.Inputs = {
}



PrinterPresentPackage.Outputs = {
	AddToCart: {}
}

PrinterPresentPackage.Category = "NikatlasPackages";
export default PrinterPresentPackage;