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-billing-address',
  templateUrl: 'customer-billing-address.component.html',
  styleUrls: ['customer-billing-address.component.scss'],
  animations: [shrinkTitleAnimation, shrinkSecondaryAnimation, shrinkMainCard],
})
export class CustomerBillingAddressComponent implements OnInit {
  expanded = true;
  constructor(private store: Store) {}
  ngOnInit(): void {}

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