mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-06-23 15:30:34 -04:00
24 lines
727 B
TypeScript
24 lines
727 B
TypeScript
import {inject, Pipe, PipeTransform} from '@angular/core';
|
|
import { DevicePlatform } from 'src/app/_models/device/device-platform';
|
|
import {TranslocoService} from "@ngneat/transloco";
|
|
|
|
@Pipe({
|
|
name: 'devicePlatform',
|
|
standalone: true
|
|
})
|
|
export class DevicePlatformPipe implements PipeTransform {
|
|
|
|
translocoService = inject(TranslocoService);
|
|
|
|
transform(value: DevicePlatform): string {
|
|
switch(value) {
|
|
case DevicePlatform.Kindle: return 'Kindle';
|
|
case DevicePlatform.Kobo: return 'Kobo';
|
|
case DevicePlatform.PocketBook: return 'PocketBook';
|
|
case DevicePlatform.Custom: return this.translocoService.translate('device-platform-pipe.custom');
|
|
default: return value + '';
|
|
}
|
|
}
|
|
|
|
}
|