import { SortMeta } from 'primeng/api'
-import { OnInit } from '@angular/core'
+import { Directive, OnInit } from '@angular/core'
import { Notifier, RestPagination, RestTable } from '@app/core'
-import { Actor } from '@app/shared/shared-main'
-import { I18n } from '@ngx-translate/i18n-polyfill'
+import { Account } from '@app/shared/shared-main'
import { AccountBlock } from './account-block.model'
import { BlocklistComponentType, BlocklistService } from './blocklist.service'
+@Directive()
+// tslint:disable-next-line: directive-class-suffix
export class GenericAccountBlocklistComponent extends RestTable implements OnInit {
// @ts-ignore: "Abstract methods can only appear within an abstract class"
abstract mode: BlocklistComponentType
constructor (
private notifier: Notifier,
- private blocklistService: BlocklistService,
- private i18n: I18n
+ private blocklistService: BlocklistService
) {
super()
}
}
switchToDefaultAvatar ($event: Event) {
- ($event.target as HTMLImageElement).src = Actor.GET_DEFAULT_AVATAR_URL()
+ ($event.target as HTMLImageElement).src = Account.GET_DEFAULT_AVATAR_URL()
}
unblockAccount (accountBlock: AccountBlock) {
() => {
this.notifier.success(
this.mode === BlocklistComponentType.Account
- ? this.i18n('Account {{nameWithHost}} unmuted.', { nameWithHost: blockedAccount.nameWithHost })
- : this.i18n('Account {{nameWithHost}} unmuted by your instance.', { nameWithHost: blockedAccount.nameWithHost })
+ ? $localize`Account ${blockedAccount.nameWithHost} unmuted.`
+ : $localize`Account ${blockedAccount.nameWithHost} unmuted by your instance.`
)
this.loadData()