<ion-refresher slot="fixed" [disabled]="!filesLoaded" (ionRefresh)="refreshFiles($event.target)">
    <ion-refresher-content pullingText="{{ 'core.pulltorefresh' | translate }}"></ion-refresher-content>
</ion-refresher>

<!-- Allow selecting the site to view. -->
<core-site-picker *ngIf="showSitePicker" [hidden]="!filesLoaded" [initialSite]="siteId" (siteSelected)="changeSite($event)">
</core-site-picker>

<core-loading [hideUntil]="filesLoaded" class="core-loading-center">
    <ion-list *ngIf="files && files.length > 0">
        <ng-container *ngFor="let file of files; let idx = index">
            <core-local-file *ngIf="file.isFile" [file]="file" [manage]="manage" [overrideClick]="pick"
                (onClick)="filePicked(file)" (onDelete)="fileDeleted(idx)" (onRename)="fileRenamed(idx, $event)">
            </core-local-file>

            <ion-item button *ngIf="!file.isFile" class="ion-text-wrap item-file" (click)="openFolder(file)">
                <ion-thumbnail slot="start" aria-hidden="true">
                    <img src="assets/img/files/folder-64.png" alt="">
                </ion-thumbnail>
                <ion-label>{{ file.name }}</ion-label>
            </ion-item>
        </ng-container>
    </ion-list>

    <core-empty-box *ngIf="files && !files.length && manage" icon="fas-folder"
        [message]="'core.sharedfiles.nosharedfiles' | translate">
    </core-empty-box>

    <core-empty-box *ngIf="files && !files.length && !manage" icon="fas-folder"
        [message]="'core.sharedfiles.nosharedfilestoupload' | translate">
    </core-empty-box>
</core-loading>
