import { Store } from '@ngxs/store';
import { Component, OnInit } from '@angular/core';
import { shrinkSecondaryAnimation, shrinkMainCard, shrinkTitleAnimation } from '../../../../shared/animations/shrink.animation';
import { UpdateCurrentBreadcrumbName } from '../../../../core/store/actions/breadcrumb.actions';

@Component({
  selector: 'app-delivery-address',
  templateUrl: 'customer-delivery-address.component.html',
  styleUrls: ['customer-delivery-address.component.scss'],
  animations: [shrinkTitleAnimation, shrinkSecondaryAnimation, shrinkMainCard],
})
export class CustomerDeliveryAddressComponent implements OnInit {
  expanded = true;
  constructor(private store: Store) {}

  ngOnInit(): void {}

  expand() {
    this.expanded = !this.expanded;
    this.store.dispatch(new UpdateCurrentBreadcrumbName(this.expanded ? 'Lieferadresse' : 'Newsletter abonnieren', 'customer'));
  }
}
