import { Component } from '@angular/core';
import { MatDialog } from '@angular/material/dialog';
import { OrderFormComponent } from '../../order-form/order-form.component';

@Component({
  selector: 'app-order-header',
  templateUrl: './order-header.component.html',
  styleUrls: ['./order-header.component.scss'],
})
export class OrderHeaderComponent {
  constructor(public readonly dialog: MatDialog) {}
  onCreateOrder(): void {
    const dialogRef = this.dialog.open(OrderFormComponent, { width: '700px' });

    dialogRef.afterClosed().subscribe((result) => {
      console.log(`Dialog result: ${result}`);
    });
  }
}
