import { Component, OnInit } from '@angular/core';
import {LoadingController, NavController} from "@ionic/angular";
import {Router} from "@angular/router";
import {SessionDataProviderService} from "../../store/session-data-provider.service";
import {WrenchService} from "../../services/wrench.service";

@Component({
  selector: 'app-ownersjob',
  templateUrl: './ownersjob.page.html',
  styleUrls: ['./ownersjob.page.scss'],
})
export class OwnersjobPage implements OnInit {
  jobData: any;
  item_banner:string = 'default.jpg';
  session_image_server:string='';
  curr_session:string="";
  tabs = 'assignjob';
  constructor(
      private navctr: NavController,
      private router: Router,
      public sessionDataProviderService: SessionDataProviderService,
      private wrenchService: WrenchService,
      private loadingCtrl: LoadingController
  ) {

    this.jobData  =  this.router.getCurrentNavigation().extras.state?.jobData;
    this.session_image_server = this.router.getCurrentNavigation().extras.state.session_image_server;
    this.item_banner = this.jobData.banner;
    if (this.jobData== undefined){
      this.onBack();
    }
  }
  onBack() {
    this.navctr.back();
  }
  ngOnInit() {
    this.curr_session =  this.sessionDataProviderService.session;
    //this.activeJobMsgList();
  }

  async sendOfferToIndividual(){
    const loading = await this.loadingCtrl.create({
      message: 'Sending...',
      duration: 5000,
    });

    loading.present();

  }

  async sendOfferToMarket(){
    const loading = await this.loadingCtrl.create({
      message: 'Sending...',
      duration: 5000,
    });

    loading.present();

  }
}
