diff --git a/src/app/widget-modules/pipes/section-type-translator/section-type.pipe.spec.ts b/src/app/widget-modules/pipes/section-type-translator/section-type.pipe.spec.ts new file mode 100644 index 0000000..aa712bf --- /dev/null +++ b/src/app/widget-modules/pipes/section-type-translator/section-type.pipe.spec.ts @@ -0,0 +1,8 @@ +import {SectionTypePipe} from './section-type.pipe'; + +describe('SectionTypePipe', () => { + it('create an instance', () => { + const pipe = new SectionTypePipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/src/app/widget-modules/pipes/section-type-translator/section-type.pipe.ts b/src/app/widget-modules/pipes/section-type-translator/section-type.pipe.ts new file mode 100644 index 0000000..cb2c8a4 --- /dev/null +++ b/src/app/widget-modules/pipes/section-type-translator/section-type.pipe.ts @@ -0,0 +1,20 @@ +import {Pipe, PipeTransform} from '@angular/core'; +import {SectionType} from '../../../modules/songs/services/text-rendering.service'; + +@Pipe({ + name: 'sectionType' +}) +export class SectionTypePipe implements PipeTransform { + + transform(value: SectionType): string { + switch (value) { + case SectionType.Verse: + return 'Strophe'; + case SectionType.Chorus: + return 'Refrain'; + case SectionType.Bridge: + return 'Bridge'; + } + } + +}