import { Pipe, PipeTransform } from '@angular/core'; import { DateOption } from '@features/configure-forms/form.typing'; import { I18nService } from '@yourcause/common/i18n'; @Pipe({ name: 'gcScheduledFormsHelpText' }) export class ScheduledFormsHelpTextPipe implements PipeTransform { constructor ( private i18n: I18nService ) { } transform (dateOption: DateOption) { switch (dateOption) { case DateOption.APPLICATION_APPROVAL_DATE: return this.i18n.translate('PROGRAM:textApplicationApprovalDateHelp', {}, 'The date the application is approved. If the date plus designated number of days has already passed the form will be sent today.'); case (DateOption.APPLICATION_SUBMITTED_DATE): return this.i18n.translate('PROGRAM:textApplicationSubmittedDateHelp', {}, 'The date the application is submitted. If the date plus designated number of days has already passed the form will be sent today.'); case (DateOption.AWARD_DATE): return this.i18n.translate('PROGRAM:textLastAwardDateHelp', {}, 'The date of the last award created for the application. If the date plus designated number of days has already passed the form will be sent today.'); case (DateOption.WORKFLOW_LEVEL_ENTRY_DATE): return this.i18n.translate('PROGRAM:textWorkflowLevelEntryDateHelp', {}, 'The date the application entered this workflow level. If the date plus designated number of days has already passed the form will be sent today.'); default: return this.i18n.translate('PROGRAM:textDefaultScheduledFormsHelp', {}, 'If the date plus designated number of days has already passed, the form will be sent today.'); } } }