<Page (loaded)="onLoad()" class="page-container">
    <ActionBar flat="true">
        <NavigationButton text="Zpět" android.systemIcon="ic_menu_back" (tap)="onBackButton()"></NavigationButton>
        <Label class="action-bar-title" text="Moje sklady" textWrap="true"></Label>
    </ActionBar>
    <StackLayout *ngIf="(isLoading$ | async) == false && othersIsLoading == false" class="page page-content">
        <StackLayout class="page-area">
            <SearchBar (clear)="onSearchClear()" (loaded)="onSearchLoaded()" (submit)="onSearchSubmit($event)"
                       class="darkWhiteBg" hint="Hledaný sklad" id="searchBar"></SearchBar>
        </StackLayout>
        <StackLayout class="page-area">
            <Label class="no-data" text="Jednotka nemá založený žádný sklad." textWrap="true"
                visibility="{{!warehousesHolder || warehousesHolder.length === 0 ? 'visible' : 'collapsed'}}"></Label>
            <Label class="no-data" text="Nebyl nalezen žádný sklad." textWrap="true"
                   visibility="{{((!warehouses || warehouses.length === 0) && warehousesHolder.length > 0) ? 'visible' : 'collapsed'}}"></Label>
            <WarehouseUnitList [warehouses]="warehouses" (tapItem)="onTapWarehouse($event)"></WarehouseUnitList>
        </StackLayout>
    </StackLayout>
    <GridLayout [visibility]="(isLoading$ | async) || othersIsLoading ? 'visible' : 'collapsed'"
                class="activity-indicator-wrapper">
        <ActivityIndicator [busy]="(isLoading$ | async) || othersIsLoading"></ActivityIndicator>
    </GridLayout>
</Page>
