import { Component } from '@angular/core';
import { NavController, NavParams } from 'ionic-angular';

import { Lead } from "../../odoo/models/crm.lead";
import { BaseDetailsView } from "../../base/base-details-view";

@Component({
    selector: 'page-lead',
    templateUrl: 'lead.html'
})
export class LeadPage extends BaseDetailsView<Lead> {

    constructor(
        public navCtrl: NavController,
        public navParams: NavParams
    ) { 
        super(Lead, navParams.data.item, navParams.data.kind);

        let titleKind = super.getKind() === "lead" ? "Iniciativa" : "Oportunidad";
        super.setTitle(super.itemExists() ? "Editar " + titleKind : "Crear " + titleKind);
    }

    /**
     * 
     */
    ionViewDidLoad() {
        console.log('ionViewDidLoad LeadPage');
    }

}
