<ion-header>
    <ion-toolbar>
        <ion-title>
            <h1>{{ 'core.contentlinks.chooseaccount' | translate }}</h1>
        </ion-title>
        <ion-buttons slot="end">
            <ion-button fill="clear" (click)="closeModal()" [attr.aria-label]="'core.close' | translate">
                <ion-icon slot="icon-only" name="fas-xmark" aria-hidden="true"></ion-icon>
            </ion-button>
        </ion-buttons>
    </ion-toolbar>
</ion-header>
<ion-content>
    <core-loading [hideUntil]="loaded">
        <ion-list>
            <ion-item class="ion-text-wrap">
                <ion-label>
                    <h2 class="item-heading">{{ 'core.contentlinks.chooseaccounttoopenlink' | translate }}</h2>
                    <p>{{ url }}</p>
                </ion-label>
            </ion-item>
            <ion-item *ngFor="let site of sites" (click)="siteClicked(site.id)" detail="false" button>
                <ion-avatar slot="start">
                    <img [src]="site.avatar" core-external-content [siteId]="site.id"
                        alt="{{ 'core.pictureof' | translate:{$a: site.fullName} }}" onError="this.src='assets/img/user-avatar.png'">
                </ion-avatar>
                <ion-label>
                    <p class="item-heading">{{site.fullName}}</p>
                    <p>
                        <core-format-text [text]="site.siteName" clean="true" [siteId]="site.id"></core-format-text>
                    </p>
                    <p>{{site.siteUrl}}</p>
                </ion-label>
            </ion-item>
        </ion-list>
    </core-loading>
</ion-content>
