Files
psp_panel/src/app/shared/components/confirmationDialog/confirmation-dialog.component.ts
T
ahasani 83c3d57866 feat: enhance product and purchase components
- Added new components for handling purchase receipts and payment wrappers.
- Updated product details view to include sales count and stock alerts.
- Refactored invoice payment form to use a template for better structure.
- Introduced confirmation dialog service for payment confirmations.
- Improved state card component for better visual representation of orders.
- Added loading indicators and error handling in various components.
- Updated routes to include new purchase functionality for suppliers.
- Enhanced stock alert component to visually indicate low stock levels.
2025-12-30 21:03:39 +03:30

49 lines
1.2 KiB
TypeScript

import { Component, EventEmitter, Input, OnDestroy, Output } from '@angular/core';
import { ConfirmationService } from 'primeng/api';
import { Button } from 'primeng/button';
import { ConfirmDialog } from 'primeng/confirmdialog';
@Component({
selector: 'app-shared-confirmation-dialog',
templateUrl: './confirmation-dialog.component.html',
providers: [ConfirmationService],
imports: [ConfirmDialog, Button],
})
export class ConfirmationDialogComponent implements OnDestroy {
@Input() message!: string;
@Input() header: string = 'تأیید عملیات';
@Input() acceptLabel: string = 'بله';
@Input() rejectLabel: string = 'خیر';
@Output() onAccept = new EventEmitter<void>();
@Output() onReject = new EventEmitter<void>();
constructor(private confirmationService: ConfirmationService) {}
show() {
this.confirmationService.confirm({
header: this.header,
message: this.message,
acceptLabel: this.acceptLabel,
rejectLabel: this.rejectLabel,
accept: () => {
this.accept();
},
reject: () => {
this.reject();
},
});
}
accept() {
this.onAccept.emit();
}
reject() {
this.onReject.emit();
}
ngOnDestroy() {
// Cleanup if needed
}
}