import { Component , ViewEncapsulation } from '@angular/core' ; import { Store } from '@ngrx/store' ; import { AppHookService } from '@alfresco/aca-shared' ; import { AppStore } from '@alfresco/aca-shared/store' ; import { ToggleJoinLibraryButtonComponent } from './toggle-join-library-button.component' ; @ Component ( { selector : 'app-toggle-join-library-menu' , template : `
    <button
      mat-menu-item
      #membership="libraryMembership"
      (toggle)="onToggleEvent($event)"
      (error)="onErrorEvent($event)"
      [adf-library-membership]="(selection$ | async).library"
      [attr.title]="(membership.isJoinRequested | async) ? ('APP.ACTIONS.CANCEL_JOIN' | translate) : ('APP.ACTIONS.JOIN' | translate)"
    >
      <mat-icon *ngIf="membership.isJoinRequested | async">cancel</mat-icon>
      <mat-icon *ngIf="!(membership.isJoinRequested | async)" svgIcon="adf:join_library"></mat-icon>
      <span>{{ (membership.isJoinRequested | async) ? ('APP.ACTIONS.CANCEL_JOIN' | translate) : ('APP.ACTIONS.JOIN' | translate) }}</span>
    </button>
  ` , encapsulation : ViewEncapsulation . None , host : { class : 'app-toggle-join-library' } } ) export class ToggleJoinLibraryMenuComponent extends ToggleJoinLibraryButtonComponent { constructor ( store , appHookService ) { super ( store , appHookService ) ; } }