import { ChangeDetectionStrategy, Component, OnInit } from '@angular/core';
import { PickupShelfFilterComponent } from '../../shared/pickup-shelf-filter/pickup-shelf-filter.component';
import { ActivatedRoute } from '@angular/router';
import { PickUpShelfInMainSideViewComponent } from '../pickup-shelf-in-main-side-view/pickup-shelf-in-main-side-view.component';

@Component({
  selector: 'page-pickup-shelf-in-main',
  templateUrl: 'pickup-shelf-in-main.component.html',
  styleUrls: ['pickup-shelf-in-main.component.css'],
  changeDetection: ChangeDetectionStrategy.OnPush,
  host: { class: 'page-pickup-shelf-in-main' },
  imports: [PickupShelfFilterComponent, PickUpShelfInMainSideViewComponent],
})
export class PickUpShelfInMainComponent implements OnInit {
  showFilter: boolean = false;

  get sideOutlet() {
    return this._activatedRoute?.parent?.children?.find((childRoute) => childRoute?.outlet === 'side')?.snapshot
      ?.routeConfig?.path;
  }

  constructor(private _activatedRoute: ActivatedRoute) {}

  ngOnInit(): void {
    this.showFilter = this.sideOutlet !== 'search';
  }
}
