import { Component, OnInit } from '@angular/core';
import { ShippingCompanyJsonld, ShippingCompanyService } from "@app/core/api/v1";
import { AppHelperService } from "@app/_helpers/app-helper.service";
import { ActivatedRoute } from "@angular/router";
import { FormMode } from "@app/_components/_abstract/abstract-data-form-component";

@Component({
    selector: 'app-shipping-company-detail',
    templateUrl: './shipping-company-detail.component.html'
})
export class ShippingCompanyDetailComponent implements OnInit {
    protected shippingCompany!: ShippingCompanyJsonld;
    protected readonly FormMode = FormMode;

    constructor(
        private shippingCompanyService: ShippingCompanyService,
        protected appHelperService: AppHelperService,
        private route: ActivatedRoute
    ) {}

    ngOnInit() {
        this.route.params.subscribe(params => {
            this.shippingCompanyService.shippingCompaniesIdGet(params['id']).subscribe(
                data => {
                    this.shippingCompany = data;
                }
            );
        });
    }
}