import { Component, OnInit, Inject } from '@angular/core';
import {MatDialog, MatDialogRef, MAT_DIALOG_DATA} from '@angular/material/dialog';

import { FundRecordData } from '../../../structures/fund-record-data';

import { emptyFundRecordFactory } from '../../../empty-objects/empty-fund-record';

import * as Globals from '../../../globals';

@Component({
  selector: 'app-edit-fund-transaction-dialog',
  templateUrl: './edit-fund-transaction-dialog.component.html',
  styleUrls: ['./edit-fund-transaction-dialog.component.scss']
})
export class EditFundTransactionDialogComponent implements OnInit {

  transaction: FundRecordData = emptyFundRecordFactory();

  constructor(public dialogRef: MatDialogRef<EditFundTransactionDialogComponent>, 
    @Inject(MAT_DIALOG_DATA) public data: { transaction: FundRecordData }) {

    this.transaction = data.transaction;
  }

  ngOnInit(): void {
  }

  close(): void {
    this.dialogRef.close();
  }

}
