import { Component } from '@angular/core'; import { PolicyService } from '@core/services/policy.service'; import { Tab } from '@yourcause/common'; @Component({ selector: 'gc-payment-processing-page', templateUrl: './payment-processing-page.component.html', styleUrls: ['./payment-processing-page.component.scss'] }) export class PaymentProcessingPageComponent { canManageProcessing = this.policies.processing.canManageProcessing(); canViewDisbursementReport = this.policies.processing.canViewDisbursementReport(); tabs: Tab[] = [ this.canManageProcessing ? { link: '/management/payment-processing/available', labelKey: 'MANAGE:textAvailable', label: 'Available', icon: 'clipboard', activeRoutes: ['manage-available'] } : undefined, this.canManageProcessing ? { link: '/management/payment-processing/batches', labelKey: 'MANAGE:textBatches', label: 'Batches', icon: 'calendar-alt', activeRoutes: ['manage-batch'] } : undefined, this.canManageProcessing ? { link: '/management/payment-processing/payments', labelKey: 'MANAGE:textCashPayments', label: 'Cash Payments', icon: 'money-bill-wave-alt' } : undefined, this.canManageProcessing ? { link: '/management/payment-processing/in-kind-payments/pending', labelKey: 'MANAGE:textInKindPayments', label: 'In-Kind Payments', icon: 'gift', activeRoutes: ['in-kind-payments'] } : undefined, this.canViewDisbursementReport ? { link: '/management/payment-processing/disbursement-report', labelKey: 'MANAGE:textDisbursementReport', label: 'Disbursement Report', icon: 'file-invoice' } : undefined].filter((item) => !!item); constructor ( private policies: PolicyService ) { } get showPanel () { return !location.pathname.includes('applicant-profile') && !location.pathname.includes('profile'); } }