import {Component, OnInit} from '@angular/core';

import {UserblockService} from './userblock.service';
import {FrameService} from '../../../core/frame/frame.service';
import {BsModalService} from 'ngx-bootstrap';
import {FrameOptrEditComponent} from '../../../routes/frame/optr/frame-optr-edit/frame-optr-edit.component';

@Component({
  selector: 'app-userblock',
  templateUrl: './userblock.component.html',
  styleUrls: ['./userblock.component.scss']
})
export class UserblockComponent implements OnInit {
  user: any;
  dept: any;

  constructor(public userblockService: UserblockService, public bsService: BsModalService) {

    this.user = FrameService.FrameOptr;
    this.dept = FrameService.FrameDept;
  }

  ngOnInit() {
  }

  userBlockIsVisible() {
    return this.userblockService.getVisibility();
  }

  openOptr() {
    const modal = Object.assign({},  {
      animated: true,
      keyboard: false,
      backdrop: true,
      ignoreBackdropClick: true,
      initialState: {},
      class: 'modal-75p'
    });
    this.bsService.show(FrameOptrEditComponent, modal);

  }
}
